title: iOS: Why BOOL property is not getting set? Value of property is nil
body: <p>In a notification handler method I am setting a BOOL property (isNotificationCarryingObject) like below:</p>
  
  <pre><code>-(void)notificationReceived:(NSNotification *)notification
  {
      //set flag depending upon if notification carries an object
      //I tried following:
  
      //1.
     self.isNotificationCarryingObject = notification.object != nil;
     //result: self.isNotificationCarryingObject = nil
  
     //2.
     self.isNotificationCarryingObject = notification.object != nil ? YES : NO;
     //result: self.isNotificationCarryingObject = nil
  
    //3.
    self.isNotificationCarryingObject = YES;
    //result: self.isNotificationCarryingObject = YES ?????
  
  }
  </code></pre>
  
  <p>Using 1. and 2. I am not able to set the flag but using 3. it gets set to YES, I don't understand why? According to me all 3 statements should work.</p>
  
  <p>isNotificationCarryingObject property is defined as:</p>
  
  <pre><code>    @property (nonatomic, assign) BOOL isNotificationCarryingObject;
  </code></pre>
  
  <p>Notification handler is inside presenting view controller. Presented view controller posts notification inside its -viewWillDisappear method which gets received by presenting view controller.</p>