Why doesn’t stopping an application in iOS simulator trigger applicationWillTerminate:?
问题 I have some code in my AppDelegate ’s applicationWillTerminate: method but I don’t know how to test if it works. Using Xcode to stop the simulator does not trigger it. How do I test the code in applicationWillTerminate:? Please note that this is specific to the simulator and not the device. 回答1: The simulator doesn't send applicationWillTerminate: because the springboard isn't sending you the kill code (SIGABRT), LLDB is. To trigger those delegate methods, you have to use the Home Button