I have noticed since upgrading to iOS5 that an audio app I have been developing is now sent the kill signal when pressing the sleep/lock button on iPhone or iPod Touch. When sliding to unlock, the app has been closed, and we are back at the springboard.
On iOS4 devices, when locking and unlocking, you would still be in the app.
I have been able to have the iOS5 enabled device play audio in the background by using Required background modes in info.plist for the app. Locking and unlocking while the AVAudioPlayer is playing, and the app resumes right as you would expect.
There must be a simple solution for this, or has iOS5 made it so your apps are all killed on lock no matter what?
Screen locking is not the same as the app going into background, and apps are certainly not killed when it happens in any version of iOS. Chances are that your app has a bug that causes it to crash when it receives the
message that is sent when the screen is locked. Perhaps a view is being released as it goes offscreen, causing an invalid pointer reference, etc.