iOS application termination


When I try to quit my iOS app (running in the simulator or on a device), my JUCEApplication’s systemRequestedQuit() and shutdown() are never called…

instead, the debugger strangely ‘pauses’ for a while (10 seconds or so), and then the debugger catches a SIGKILL in:
int juce_iOSMain (int argc, const char* argv[])

This happens with the JuceDemo too. iOS5.0, Xcode 4.3.

(This is not when you press the home button once to send the app to the background, it’s when you double-click the home button and then long-press the app until it starts dancing, and then close it from there.)

Any ideas? Thanks!


When you go to the task bar (home twice), and use the red X, you aren’t doing a graceful shutdown. You are force killing the app. The application delegate “applicationWillTerminate” is never fired, so the JUCE method JUCEApplicationBase::appWillTerminateByForce() is never called.

If you have cleanup/preservation to do, you really should be responding to applicationDidEnterBackground and applicationWillEnterForeground (see the iOS programming guide). Jule’s doesn’t handle these, but they aren’t hard to add. They also match up well the the onPause and onResume activity methods in Android.