title: How to send & receive data using NSNotificationCenter in iOS (XCode6.4)
body: <p>I am facing an issue with NSNotificationCenter.</p>
  
  <p>I am not able to send message and receive message using NSNotificationCenter in latest ios 8.4 (XCode 6.4)</p>
  
  <p>Please check the following code:</p>
  
  <p>1) I want to send data using first view controller to another view.
  so i have written the following code in first viewcontroller:</p>
  
  <p>When user btn clicked method as following :</p>
  
  <pre><code>- (IBAction)btnClicked:(id)sender 
  { 
    [self postNotification];
    [self performSegueWithIdentifier:@"asGo" sender:self]; 
  } 
  
  -(void)postNotification{
  
      [[NSNotificationCenter defaultCenter] postNotificationName:@"MyNotification" object:self];
  }
  </code></pre>
  
  <p>2) In Second view controller i have added observer in ViewWillApper  as following :</p>
  
  <pre><code>-(void) viewWillAppear:(BOOL)animated
  {
   [super viewWillAppear:YES];
  
      [[NSNotificationCenter defaultCenter] addObserver:self
                                                       selector:@selector(eventListenerDidReceiveNotification:)
                                                           name:@"MyNotification"
                                                         object:nil];
  }
  
  
  -(void)eventListenerDidReceiveNotification:(NSNotification*)txt
  {
   NSLog(@"i got notfication:");
  } 
  </code></pre>
  
  <p>so eventListenerDidReceiveNotification is not called while come on view.
  But i am not getting above log while i come on second vc with navigation</p>