How to remove Notification observer in ios
<p>Hi i am very new for ios and in my app i have created two view controllers</p>

<p>in my first view controllers i have added one button and when i click that button i am pushing second viewcontroller</p>

<p>in my second viewcontroller i have added NSNotificationCenter for checking app states this is working fine</p>

<p>my main problem is when i push back from second viewcontroller to first viewcontroller and i close the app once and opening again </p>

<p>then Here i wonder second view controller class NSLog statement is printing in this class </p>

<p>why this silly happening how can i stop this action please help me</p>

<h2>FirstViewcontroller:-</h2>

<pre><code>#import "FirstViewcontroller.h"

@interface FirstViewcontroller ()

@end

@implementation FirstViewcontroller

- (void)viewDidLoad {
    [super viewDidLoad];

}
- (IBAction)buttonAction:(id)sender {

    ViewController1 *details = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController1"];
        [self presentViewController:details animated:YES completion:nil];
}

@end
</code></pre>

<h2>SecondViewcontroller:-</h2>

<pre><code>#import "SecondViewcontroller.h"

@interface SecondViewcontroller ()

@end

@implementation SecondViewcontroller

- (void)viewDidLoad {
    [super viewDidLoad];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidBecomeActive:) name:UIApplicationDidBecomeActiveNotification object:nil];
}

- (void)appDidBecomeActive:(NSNotification *)notification {

    NSLog(@"did become active notification");
}

@end
</code></pre>