Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ios 5
- //responding to application level events
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- [[NSNotificationCenter defaultCenter]
- addObserver:self
- selector:@selector(willEnterForegroundNotification:)
- name:UIApplicationWillEnterForegroundNotification
- object:nil];
- [[NSNotificationCenter defaultCenter]
- addObserver:self
- selector:@selector(willResignActiveNotification:)
- name:UIApplicationWillResignActiveNotification
- object:nil];
- // Do any additional setup after loading the view.
- }
- - (void)willEnterForegroundNotification:(NSNotification *)notification
- {
- //app is returning to foreground from background
- }
- - (void)willResignActiveNotification:(NSNotification *)notification
- {
- //home button is pressed
- }
Advertisement
Add Comment
Please, Sign In to add comment