title: NSNotification is not calling @selector method
body: <p>I am trying to pass NSString from one class to another. Let's say I have ViewController A and ViewController B. I want to pass NSString from A to B.</p>
  
  <p>In ViewController A, I have following code :</p>
  
  <pre><code>[[NSNotificationCenter defaultCenter] postNotificationName:@"NotificationMessageEvent" object:userType];
  </code></pre>
  
  <p>//Here user type is a string I get using delegate and I need to pass this userType to ViewController B</p>
  
  <p>In ViewController B, I have following code :
  In viewDidLoad , I have following code :</p>
  
  <pre><code>[NSNotificationCenter defaultCenter]
       addObserver:self selector:@selector(notificationAction:) name:@"NotificationMessageEvent" object:nil];
  </code></pre>
  
  <p>//This NSNotificationCenter method is called</p>
  
  <p>I have registered the following selector method.</p>
  
  <pre><code>-(void) notificationAction:(NSNotification *) notification
  {
      if ([notification.object isKindOfClass:[NSString class]])
      {
          NSString *message = [notification object];
          // do stuff here with your message data
          NSLog(@"%@ is message",message);
      }
      else
      {
          NSLog(@"Error, object not recognised.");
      }
  }
  </code></pre>
  
  <p>//The above selector method is never called. </p>
  
  <p>I have read other similar stackoverflow answers but I have not been able to find any solutions regarding this. </p>