Is NSTimer expected to fire when app is backgrounded?

NSTimer is going to fire whenever the main runloop is running. Apple makes no promises that I know of to unschedule timers or to prevent the main runloop from running. It’s your responsibility to unschedule your timers and release resources when you move to the background. Apple isn’t going to do it for you. They may, however, kill you for running when you are not supposed to or using too many seconds.

There are many holes in the system that will allow an app to run when it isn’t authorized to. It would be very expensive for the OS to prevent this. But you cannot rely on it.

Leave a Comment