I've noticed that several iPhone apps, especially some more graphically intensive games take quite a while to exit when the home button is pressed.
My question is, weather it's possible to artificially recreate this situation, the reason being, that I'm trying to implement a sort of "phone protector" that starts making loud noises when some accelerometer data is read. The idea would be to have the AVAudioPlayer keep playing the sound for as long as possible (ie. until the iPhoneOS decides to kill the process for good).
I tried something like this in my app delegate, just to see how it reacts:
-(void)applicationWillTerminate:(UIApplication *)application{
NSInteger i;
while(true) {
i++;
}
}
What happens though, is that the home screen comes up immediately and the sound stops playing (the AVAudioPlayer instance is in a view controller), but the applications process is still in memory and in fact stops me from launching a new instance of the app until the old one is killed manually (this is all in the Simulator).
Any ideas?