In an iOS 6 app I have some view controllers that are added as observers with the default notification center. They are added in the viewDidLoad method because I want the controllers to receive the notifications even when they are not on top.
A lot of people recommend removing the observer in the dealloc method. However, I have been logging messages with NSLog() both when adding and removing the observer, and it looks like dealloc is never called (I am using ARC).
Contrary to what one would think, the viewDidUnload method is not an option, since in iOS 5 it was only called during low-memory conditions, and in iOS 6 it is not called at all.
It actually seems that there is no way to do what the documentation requires! So far, my application has not crashed, by the way, even though controllers are being added multiple times and (apparently) never removed.
Note: So far I have been testing with the simulator only; is it possible that dealloc does get called in an actual device, but not in the simulator? Or is the call to NSLog() just not showing up (it shows up everywhere else, though).
Even in arc, dealloc is called. You cannot call [super dealloc] in arc but dealloc should be called if your view controller is being released. But, if you find it really difficult to manage, the situation why dont you add the notification observer in viewWillAppear and then remove it in viewWillDisappear. That way you will get notification until the view is shown and while the view is not shown, it may be released so it does not bother much to remove observer in viewWillDisappear. But, surely enough dealloc is called and is a good place for this.