If you have something processing and the user presses the home button, does iOS let the app finish processing until it's finished? I have an NSTimer that calls a function every half second, and I want to know if iOS sort of freezes the app where it was, or if it allows the function to finish before suspending the app.
Also does pressing the home button pause an NSStream, or does it close the NSStream.
You get a notification prior to the app being suspended in your UIApplicationDelegate. Look into the applicationWillResignActive:
method. If you insert your cleanup code there, you can gracefully suspend, or request more processing time via the UIApplicationDelegate method beginBackgroundTaskWithExpirationHandler:
. See the Apple documentation for more info.