Search Results

Search found 8409 results on 337 pages for 'itunes sdk'.

Page 158/337 | < Previous Page | 154 155 156 157 158 159 160 161 162 163 164 165  | Next Page >

  • When my UIViewController accesses an NSArray in my AppDelegate from an IBAction it crashes the progr

    - by JasonClark
    I have a couple UIViewControllers that I am trying to access an array inside my AppDelegate. When I use an IBAction UIButton and in that method I access my AppDelegate my program dies silently. Nothing in output or the debugger, it just stops. If I run it several times I can see that it is failing to access the array properly. To investigate this problem I created a very basic app. In my AppDelegate.h I declared and set properties for the array #import <UIKit/UIKit.h> @class MyViewController; @interface MyAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; MyViewController *viewController; NSArray *images; } @property (nonatomic, retain) NSArray *images; @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet MyViewController *viewController;` In the AppDelegate.m I synthesised and initialized the NSArray (Also made sure the images were added to the Resources folder). @synthesize images; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { images = [NSArray arrayWithObjects: [[NSBundle mainBundle] pathForResource:@"bamboo_nw" ofType:@"jpg"], ..... nil]; NSLog(@"init images size:%i",[images count]); [window addSubview:viewController.view]; [window makeKeyAndVisible]; return YES; } In my UIViewController.h I added class, imported header file, declared, and set properties for my AppDelegate pointer. #import <UIKit/UIKit.h> #import "MyAppDelegate.h" @class MyAppDelegate; @interface MyViewController : UIViewController { MyAppDelegate *mainDelegate; IBOutlet UIButton mybutton; } @property (nonatomic, retain) MyAppDelegate mainDelegate; @property (nonatomic, retain) UIButton *mybutton; -(IBAction) doSomething;` In my UIViewController.m I synthesize and assign my AppDelegate. I set up an IBAction that will log the same count of the NSArray from the AppDelegate. #import "MyViewController.h" #import "MyAppDelegate.h" @implementation MyViewController @synthesize mybutton; - (void)viewDidLoad { mainDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate]; NSLog(@"vdl images size:%i",[mainDelegate.images count]); [super viewDidLoad]; } -(IBAction) doSomething { NSLog(@"ds images size:%i",[mainDelegate.images count]); } I print the size of the NSArray in the AppDelegate when I create it, in the ViewController when I first assign my AppDelegate pointer, and then as a result of my IBAction. I find that everytime I hit the button the program dies. On the third time I hit the button, I saw that it ran my IBAction but printed my array size as 1 instead of 8. Am I missing something? Also, why don't I get stack traces or anything, the debugger just dies silently? Thanks in advance for any help! Debugger Console output for 3 runs: [Session started at 2010-05-10 06:21:32 -0700.] 2010-05-10 06:21:44.865 My[59695:207] init images size:8 2010-05-10 06:21:47.246 My[59695:207] vdl images size:8 [Session started at 2010-05-10 06:22:15 -0700.] 2010-05-10 06:22:18.920 My[59704:207] init images size:8 2010-05-10 06:22:19.043 My[59704:207] vdl images size:8 [Session started at 2010-05-10 06:22:23 -0700.] 2010-05-10 06:22:25.966 My[59707:207] init images size:8 2010-05-10 06:22:26.017 My[59707:207] vdl images size:8 2010-05-10 06:22:27.814 My[59707:207] ds images size:1

    Read the article

  • Does this have to be released?

    - by NextRev
    I've done a lot of research on when it's correct to release things, but it's all confusing to me. I think sometimes the Leaks program is off. Anyway... background is a UIImageView background.image = [UIImage imageNamed:@"greenbackground.png"]; Do I have to release background? I never alloced it and it's not set as a property, so I'm thinking no.

    Read the article

  • presenting modal views in a popover

    - by sengbsd
    Hi, Im trying to load a modal view from a view controller that is displayed in a popover. The modal view loads but the problem is that it transitions into the main view and not within the popover. Is it something Im missing? I thought simply initiating it from a vc within a popover would present the modal view within the same popover... The code is nothing special as bellow: - (IBAction)myButton{ ModalVC *controller = [[ModalVC alloc] initWithNibName:@"ModalVC" bundle:nil]; [self presentModalViewController:controller animated:YES]; [controller release]; }

    Read the article

  • image upload on server

    - by user338322
    I am trying to upload an image to server using iphone . I haven't done it before. But I am not getting how can i do it. I know how to add text data on server. But how to add the image data or an Image to server . Can any one suggest!?

    Read the article

  • Core Data and Relationships

    - by alku83
    I have two objects, a Trip and a Place. A Trip represents a journey from one Place to another Place, ie. a Trip needs a fromPlace and a toPlace. So, this is a 1-to-2 relationship, but I need to know which is the "from" and which is the "to". I am not sure how to model this in Core Data. I have created two entities (Trip, Place), and now I want to setup the relationship(s) so I have a fromPlace and a toPlace. Do I need to add an extra field on the Place entity called isFrom, or similar? If this was in a database, I would just have a id column on the Place table, and then two columns in the Trip table - fromPlaceId and toPlaceId. How do I achieve something similar in Core Data?

    Read the article

  • inserting new relationship data in core-data

    - by michael
    My app will allow users to create a personalised list of events from a large list of events. I have a table view which simply displays these events, tapping on one of them takes the user to the event details view, which has a button "add to my events". In this detailed view I own the original event object, retrieved via an NSFetchedResultsController and passed to the detailed view (via a table cell, the same as the core data recipes sample). I have no trouble retrieving/displaying information from this "event". I am then trying to add it to the list of MyEvents represented by a one to many (inverse) relationship: This code: NSManagedObjectContext *context = [event managedObjectContext]; MyEvents *myEvents = (MyEvents *)[NSEntityDescription insertNewObjectForEntityForName:@"MyEvents" inManagedObjectContext:context]; [myEvents addEventObject:event];//ERROR And this code (suggested below): //would this add to or overwrite the "list" i am attempting to maintain NSManagedObjectContext *context = [event managedObjectContext]; MyEvents *myEvents = (MyEvents *)[NSEntityDescription insertNewObjectForEntityForName:@"MyEvents" inManagedObjectContext:context]; NSMutableSet *myEvent = [myEvents mutableSetValueForKey:@"event"]; [myEvent addObject:event]; //ERROR Bot produce (at the line indicated by //ERROR): *** -[NSComparisonPredicate evaluateWithObject:]: message sent to deallocated instance Seems I may have missed something fundamental. I cant glean any more information through the use of debugging tools, with my knowledge of them. 1) Is this a valid way to compile and store an editable list like this? 2) Is there a better way? 3) What could possibly be the deallocated instance in error? -- I have now modified the Event entity to have a to-many relationship called "myEvents" which referrers to itself. I can add Events to this fine, and logging the object shows the correct memory addresses appearing for the relationship after a [event addMyEventObject:event];. The same failure happens right after this however. I am still at a loss to understand what is going wrong. This is the backtrace #0 0x01f753a7 in ___forwarding___ () #1 0x01f516c2 in __forwarding_prep_0___ () #2 0x01c5aa8f in -[NSFetchedResultsController(PrivateMethods) _preprocessUpdatedObjects:insertsInfo:deletesInfo:updatesInfo:sectionsWithDeletes:newSectionNames:treatAsRefreshes:] () #3 0x01c5d63b in -[NSFetchedResultsController(PrivateMethods) _managedObjectContextDidChange:] () #4 0x0002e63a in _nsnote_callback () #5 0x01f40005 in _CFXNotificationPostNotification () #6 0x0002bef0 in -[NSNotificationCenter postNotificationName:object:userInfo:] () #7 0x01bbe17d in -[NSManagedObjectContext(_NSInternalNotificationHandling) _postObjectsDidChangeNotificationWithUserInfo:] () #8 0x01c1d763 in -[NSManagedObjectContext(_NSInternalChangeProcessing) _createAndPostChangeNotification:withDeletions:withUpdates:withRefreshes:] () #9 0x01ba25ea in -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] () #10 0x01bdfb3a in -[NSManagedObjectContext processPendingChanges] () #11 0x01bd0957 in _performRunLoopAction () #12 0x01f4d252 in __CFRunLoopDoObservers () #13 0x01f4c65f in CFRunLoopRunSpecific () #14 0x01f4bc48 in CFRunLoopRunInMode () #15 0x0273878d in GSEventRunModal () #16 0x02738852 in GSEventRun () #17 0x002ba003 in UIApplicationMain () solution I managed to get to the bottom of this. I was fetching the event in question using a NSFetchedResultsController with a NSPredicate which I was releasing after I had the results. Retrieving values from the entities returned was no problem, but when I tried to update any of them it gave the error above. It should not have been released. oustanding part of my question What is a good way to create this sub list from a list of existing items in terms of a core data model. I don't believe its any of the ways I tried here. I need to show/edit it in another table view. Perhaps there is a better way than a boolean property on each event entity? The relationship idea above doesn't seem to work here (even though I can now create it). Cheers.

    Read the article

  • How do I send text to a UITextView?

    - by Lee
    I'm new to iphone development. I'm a VB programmer who is trying to convert a VB application to an ipad app. I need some help with sending text to a UITextView. I want to first have a UIPickerView and then once the user hits a UIButton, a UITextView appears and the text is then generated by my source code code, line by line. The code would constantly be concatenating strings to the text. It would sort of go like this-- 1) User makes selections with UIPickerView. 2) User then hits UIButton. 3) UIPickerView is replaced on the screen with a UITextView. 4) The code does stuff. 5) The code adds the 1st line of text into the UITextView. 6) The code does more stuff. 7) The code then adds the 2nd line of text into the UITextView, retaining the 1st line that was already there. Steps 6 and 7 are repeated until the code is done. Does anyone know of any examples of this that I could look at? I am mostly interested in finding something like a youtube video, a webpage that explains the code or even a good book that covers this particular topic. I am finding that the sample codes that Apple has on this site goes over my head. In fact, I could probably benefit from a good book. But, I am looking for one that I would already know covers this particular topic, since it is so essential to the app that I am trying to build.

    Read the article

  • How does Twitter for iPhone bookmarklet work?

    - by Igor Zevaka
    Twitter client (formerly Tweetie) allows you to define a bookmarklet in Safari that launches the app. I want to know which iPhone API allows you to register the protocol specifier (or whatever it's called) - in this case "tweetie:" - in order for this bookmarklet to work. The instructions can be found here and the bookmarklet itself is below. javascript:window.location='tweetie:'+window.location Clicking the above bookmark is the same as typing in "tweetie:http://google.com" into the address bar. This is obviously supported on the OS/Browser level, much the same as tel: URIs. Am I correct in understanding that developers can add arbitrary URI protocol specifiers as a part of app installation?

    Read the article

  • In-app subscription apps

    - by Ron Srebro
    Does anyone know of an app that implemented an in-app subscription? I thought about how the subscription model can be implemented and always ends up with more problems to every possible solution I can think of, so I'm wondering if anyone knows of an app that actually does that. Thanks

    Read the article

  • webOS style view switching on iPhone app

    - by Taylor Satula
    Hello, I have been working with a iPhone app that I would like to have switch views like the Palm Pre does for multitasking. I know the usual way of switching views by using the black bar at the bottom of the app but the app I am working on does not lend itself to having a big black bar in the way (see attached picture #1). I guess my question is, how do I shrink the current view (Current Location window) and show other views on the sides? (see attached picture #2) Then be able to swipe left and right to view other views. I have no idea how to do this and would be eternally grateful if someone could help me out with this. http://www.threepixeldrift.com/images/deep-storage/webOScardapp1.jpg http://www.threepixeldrift.com/images/deep-storage/webOScardapp2.jpg

    Read the article

  • Setting Grouping in UITableView under UINavigationController

    - by climbon
    In my UINavigationController app, my first view is a UITableView. I can't seem to find a way to set the property of this UITableView to 'grouped'. Since UITableView is dynamically generated I don't have the luxury of Interface Builder. Searched forums here and googled other places and closest I saw was to override either initWithStyle or initWithCoder as follows. (id)initWithStyle:(UITableViewStyle)style { if (self = [super initWithStyle:UITableViewStyleGrouped]) { } return self; } However this above function never gets called. when I overrided initWithCoder I could see it worked and I was able to change UITableView contents to grouped. But then title automatically became 'Root View Controller' and none of the cells were active anymore although they got grouped fine. That is while they looked active but if you click on them, those cells won't do anything. But I have seen apps which have their very first view being UITableView is grouped. So there must be a way to do it but I don't know how.

    Read the article

  • Why does addSubview load the view asynchronously

    - by moshe
    I have a UIView that I want to load when the user clicks a button. There happens to be some data processing that happens as well after I call addSubview that involves parsing an XML file retrieved from the web. The problem is the view doesn't show up until after the data processing even if addSuview is called first. I think I'm missing something here, can anyone help? Code: I have a "Loading..." view I'm adding as a custom modal (meaning I'm not using the modalViewController). This action is linked to a button in the navigationController. - (IBAction)parseXml:(id)sender { LoadingModalViewController *loadingModal = [[LoadingModalViewController alloc] initWithNibName:@"LoadingModalViewController" bundle:nil]; [navigationController.view addSubview:loadingModal.view]; [xmlParser parse]; }

    Read the article

  • How can I present a modal view controller after selecting a contact?

    - by barfoon
    Hey everyone, I'm trying to present a modal view controller after selecting a contact and it doesnt seem to be working. In my - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person method, I dismiss peoplePicker, create an instance of my new view controller, then present it with [self.navigationController presentModalViewController:newController animated:YES]; and it doesnt work. However if i PUSH the view controller it works with this code: [self.navigationController pushViewController:newController animated:YES]; How can I accomplish this? Thank you,

    Read the article

  • Android App - disappearance of app GUI

    - by Radek Šimko
    I'm trying to create a simple app, whose main task is to open the browser on defined URL. I've created first Activity: public class MyActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setContentView(R.layout.main); Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://my.url.tld")); startActivity(myIntent); } Here's my AndroidManifest.xml: <manifest ...> <application ...> <activity android:name=".MyActivity" ...> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> This code is fully functional, but before it opens the browser, it displays a black background - blank app GUI. I didn't figured out, how to go directly do the browser (without displaying the GUI). Anyone knows?

    Read the article

  • Blurred PNGs on UIView, using Interface Builder

    - by Christopher Stamper
    Hey everyone, I've added some UIImageViews with png images to my view, using interface builder. Initially they are added off-screen. Later, I animate them onto the screen with CoreAnimation, like so: [UIView beginAnimations:@"slide" context:nil]; [UIView setAnimationDuration:0.1f]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDelegate:self]; image.frame = CGRectMake(81+1, 390, 150, 80); [UIView commitAnimations]; Once they appear onscreen, they look really blurred or fuzzy. I've heard of this happening before. Does anyone have any idea how to fix it?

    Read the article

  • How to start writing out an existing AudioQueue in response to an event?

    - by Halle
    Hello, I am writing a class that opens an AudioQueue and analyzes its characteristics, and then under certain conditions can begin or end writing out a file from that AudioQueue that is already instantiated. This is my code (entirely based on SpeakHere) that opens the AudioQueue without writing anything out to tmp: void AQRecorder::StartListen() { int i, bufferByteSize; UInt32 size; try { SetupAudioFormat(kAudioFormatLinearPCM); XThrowIfError(AudioQueueNewInput(&mRecordFormat, MyInputBufferHandler, this, NULL, NULL, 0, &mQueue), "AudioQueueNewInput failed"); mRecordPacket = 0; size = sizeof(mRecordFormat); XThrowIfError(AudioQueueGetProperty(mQueue, kAudioQueueProperty_StreamDescription, &mRecordFormat, &size), "couldn't get queue's format"); bufferByteSize = ComputeRecordBufferSize(&mRecordFormat, kBufferDurationSeconds); for (i = 0; i < kNumberRecordBuffers; ++i) { XThrowIfError(AudioQueueAllocateBuffer(mQueue, bufferByteSize, &mBuffers[i]), "AudioQueueAllocateBuffer failed"); XThrowIfError(AudioQueueEnqueueBuffer(mQueue, mBuffers[i], 0, NULL), "AudioQueueEnqueueBuffer failed"); } mIsRunning = true; XThrowIfError(AudioQueueStart(mQueue, NULL), "AudioQueueStart failed"); } catch (CAXException &e) { char buf[256]; fprintf(stderr, "Error: %s (%s)\n", e.mOperation, e.FormatError(buf)); } catch (...) { fprintf(stderr, "An unknown error occurred\n"); } } But I'm a little unclear on how to write a function that will tell this queue "from now until the stop signal, start writing out this queue to tmp as a file". I understand how to tell an AudioQueue to write out as a file at the time that it's created, how to set files format, etc, but not how to tell it to start and stop midstream. Much appreciative of any pointers, thanks.

    Read the article

  • Why didn't Apple initially implement copy and paste in the iPhone?

    - by Howiecamp
    Why didn't Apple implement copy and paste prior to iPhone OS 3.0? The answers I don't think are correct (but I could certainly be wrong) are: They couldn't figure out how to do it and provide a good user experience Some crazy multi-tasking or battery limitation iPhone users didn't want or need it (this was Microsoft's argument and is totally specious) Thoughts?

    Read the article

< Previous Page | 154 155 156 157 158 159 160 161 162 163 164 165  | Next Page >