Return to Snippet

Revision: 52234
at October 17, 2011 18:53 by cdarken


Initial Code
//add this when initializing controller
[[NSNotificationCenter defaultCenter] addObserver:self 
    selector:@selector(becomeActive:)
    name:UIApplicationDidBecomeActiveNotification
    object:nil];

//add the actual method in the controller

- (void)becomeActive:(NSNotification *)notification {
    NSLog(@"becoming active");
}

//be sure to clean up the notification

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [super dealloc];
}

Initial URL


Initial Description


Initial Title
notify view controller when application becomes active

Initial Tags
iphone

Initial Language
Objective C