Notified crashes when launching from alert window on iOS 5


#1

I’m trying to test the new code on the bottom of page 501:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    NSDictionary *remoteDict = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
    if (remoteDict) {
        [self application:application didReceiveRemoteNotification:remoteDict];
    }
    // rest of the code follows
}

The test case provided on pg 502 says: "Exit the application and kill it from the dock. Then send another notification an tap the View button. The text of the alert will appear in the UITextView once Notified has relaunched. I followed these instructions and my Notified app crashes with a green line in Notified’s main.m. This is the line the green marker’s on: return UIApplicationMain(argc, argv, nil, nil);

I’m testing this on iOS 5, and the strange thing is that if I don’t kill the app in the dock, it works. Only when I kill the app in the dock and then try to launch Notified, the app crashes.

Anyone encountered this problem and has a fix for it?

Thanx in advance!


#2

Here’s an update:
This crash seems to happen when I run the Notified app via XCode’s Run command. When I launch the Notified app straight from the device, I haven’t gotten the crash yet.


#3

I get a similar response from other apps force terminated on a device. According to a post I read on stackoverflow.com the message Program received signal “SIGKILL” appears in the Xcode debugger when an iOS 4 app is force terminated by selecting the red close button from the multitasking bar. The post states “This is to be expected, the multitasking bar “red minus button” is the equivalent of force quitting an application on Mac OS X. This is the documented behavior.” The solution in my case is to remove the app from the device then run again from Xcode and all is well.

Fred