I have an objective C class. In it, I created a init method and set up a NSNotification in it
//Set up NSNotification
[[NSNotificationCenter defaultCenter] a
In my opinion, the following code makes no sense in ARC:
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
In iOS 6, there's also no sense in removing observers in viewDidUnload, because it has been deprecated now.
To sum up, I always do it in viewDidDisappear. However, it depends on your requirements also, just like @Dirk said.