I have a class with this method call within dealloc:
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
Where would I remove myself from the notification center once I convert the class to ARC? Should it go within viewDidUnload? The notification is used to listen for events that come from a modal view controller, so I cannot put this code into viewWillDisappear.
The
deallocstays in ARC, it’s just that you shouldn’t be calling[super dealloc]any longer: the compiler inserts the code for you. And of course all the calls toreleasecannot be made indealloc(or anywhere else).