-
-
Save action456789/a5b5e4028531a1f7ff7fd6dc444e39b6 to your computer and use it in GitHub Desktop.
[NSNotification] #Objective-C
This file contains 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)addNotification { | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(applicationDidBecomeActive) name:UIApplicationDidBecomeActiveNotification | |
object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(applicationWillResignActive) | |
name: UIApplicationWillResignActiveNotification | |
object:nil]; | |
} | |
- (void)removeNotification { | |
[[NSNotificationCenter defaultCenter] removeObserver:self]; | |
} | |
- (void)applicationWillResignActive { | |
} | |
- (void)applicationDidBecomeActive { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment