applicationWillTerminate: not being called

From Apple docs: For applications that do not support background execution or are linked against iOS 3.x or earlier, this method is always called when the user quits the application. For applications that support background execution, this method is generally not called when the user quits the application because the application simply moves to the … Read more

Is it good practice to use AppDelegate for data manipulation and Handling?

It’s not a good strategy to turn your AppDelegate into a “big ball of mud” that contains a million methods and properties (although it might be tempting). A better and more object oriented approach to section off bits of functionality into well-designed objects — for example you might have a class DatabaseManager which handles all … Read more

didReceiveRemoteNotification: fetchCompletionHandler: open from icon vs push notification

Ok I figured it out. The method is actually called twice (once when it receives the push, and once when the user interacts with the icon or the notification). – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { if(application.applicationState == UIApplicationStateInactive) { NSLog(@”Inactive”); //Show the view with the content of the push completionHandler(UIBackgroundFetchResultNewData); } else if … Read more

What describes the Application Delegate best? How does it fit into the whole concept?

In Cocoa, a delegate is an object that another object defers to on questions of behavior and informs about changes in its state. For instance, a UITableViewDelegate is responsible for answering questions about how the UITableView should behave when selections are made or rows are reordered. It is the object that the UITableView asks when … Read more

Behaviour for significant change location API when terminated/suspended?

Since I asked this question, I have done a fair bit of testing (mostly on the train between home and work) and have confirmed that the behaviour for suspended apps is as I suspected at the end of the question. That is, your suspended app is woken up, you don’t receive any callbacks on your … Read more

What is a “delegate” in Objective C’s iPhone development? [duplicate]

A delegate is a pointer to an object with a set of methods the delegate-holder knows how to call. In other words, it’s a mechanism to enable specific callbacks from a later-created object. A good example is UIAlertView. You create a UIAlertView object to show a short message box to users, possibly giving them a … Read more

iPhone GPS in background never resumes after pause

If you search for pausesLocationUpdatesAutomatically on the Apple forums you’ll find a recent question along similar lines which has had a response from an Apple developer. I won’t repost it directly here since it is a private forum, but the gist is that the location pausing is for instances when the user forgets that they … Read more