Created
November 12, 2014 11:15
-
-
Save priore/1daa138d38f8cee0ff29 to your computer and use it in GitHub Desktop.
Tips: a solid dealloc for all classes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)dealloc | |
| { | |
| [NSObject cancelPreviousPerformRequestsWithTarget:self]; | |
| [[NSNotificationCenter defaultCenter] removeObserver:self]; | |
| if ([self respondsToSelector:@selector(setDelegate:)]) | |
| [self performSelector:@selector(setDelegate:) withObject:nil]; | |
| [super dealloc]; // not needed in ARC | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment