SIGKILL signal on stopping app in simulator


After adding in the code to save images to the iOS filesystem, I did as suggested at the top of p.291, and I ran the app and then “kill(ed) it from the dock.” I was running on the simulator. This results in the debugger halting on the return UIApplicationMain… line in main:

int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([WhereamiAppDelegate class])); } }
Thinking I must have done something horribly wrong, I backed out all the changes, but the problem remained. So, I rebuilt the Whereami app and tried killing it. Same result.

So, I now ask, is it normal to receive a SIGKILL signal when killing an app from the iOS dock, and if so, is it normal that the debugger halts as I’ve described?


Yup, the simulator is sending the kill signal to the app that is running. Xcode picks up on that and tells you it happened. Kind of a pain, honestly, but the alternative would be to never trap on the kill signal.