title: NSNotification not fired from inside the dispatch async
body: <p>I have the following code: </p>
  
  <p>Inside the session completionHandler I have a dispatch_async which contains the call to the NSNotificationCenter post Notification method. But the notification is never fired Any ideas! </p>
  
  <pre><code>NSURLSession *session = [NSURLSession sharedSession];
  
  [[session dataTaskWithURL:[NSURL URLWithString:url] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  
      // populating appDelegate.statusItems variable ///// 
  
     ....... 
  
      dispatch_async(dispatch_get_main_queue()
                     , ^{
  
                         [[NSNotificationCenter defaultCenter] postNotificationName:@"DataReceived" object:nil userInfo:@{@"StatusItems":appDelegate.statusItems}];
  
                          [self performSegueWithIdentifier:@"DashboardSegue" sender:nil];
                     });
  
  
  
  }]resume];
  </code></pre>
  
  <p>Inside the LoginViewController (the code is above) I also register the notifications for the listeners but they are never called: </p>
  
  <pre><code>    -(void) setupNotifications
      {
          ViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController"];
  
          [viewController registerNotifications];
  
      }
  
  
  -(void) registerNotifications
  {
      [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(populateList:) name:@"DataReceived" object:nil];
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  }
  
  -(void) populateList:(NSNotification *) notification
  {
      NSDictionary *dict = notification.userInfo;
  
      _statusItems =  [dict valueForKey:@"StatusItems"];
  
      dispatch_async(dispatch_get_main_queue(), ^{
          [self.tableView reloadData];
      });
  
  }
  </code></pre>