Question

How does ios deal with notifications for an app that it decided to terminate while the app was suspended? My understanding is that suspended apps do not get warned and so can't remove it's observers itself.

Was it helpful?

Solution

The default notification centre and any you've created yourself get terminated with the process. The default centre is per-app not systemwide. As a result the dangling pointers that would result if, in the normal run of things, you let a class be deallocated without removing itself from the notification centre aren't a problem and aren't something you need manage.

OTHER TIPS

+[NSNotificationCenter defaultCenter] is process-specific. So don’t worry about it.

(Side note: most applications worry far too much about cleaning up stuff when they quit. Once in a great while there is a global resource that needs to be talked to, but I’ve seen games go through and deallocate each sprite and particle, when the user just explicitly told them to stop.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top