How to react to applicationWillResignActive from anywhere?

Looks like you are looking for this code.

- (void) applicationWillResign {
    NSLog(@"About to lose focus");
}

- (void) myMethod { 
    [[NSNotificationCenter defaultCenter]
        addObserver:self
        selector:@selector(applicationWillResign)
        name:UIApplicationWillResignActiveNotification 
        object:NULL];
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)