title: tableView didSelectRowAtIndexPath doesn't work properly on iOS 7. Why?
body: <p>In first place I would like to say that I'm only making this question, because I would like to understand what is happening.</p>
  
  <p>I opened an old Xcode project (a very simple one) in a fresh installation on Xcode5.
  When I realize that it doesn't work on iOS 7. Why? Don't know..</p>
  
  <p>I saw some other questions, didn't get any useful answer, so I made a simple test.
  In the <code>UITableViewController</code> all works fine except on <code>didSelectRowAtIndexPath</code> </p>
  
  <p>Check it out</p>
  
  <p>RootViewController.h:</p>
  
  <pre><code>@interface RootViewController : UITableViewController
  
  @property (strong, nonatomic) NSMutableArray *items;
  @end
  </code></pre>
  
  <p>RootViewController.m
  In viewDidLoad I init the array (with some strings).</p>
  
  <p>Implement the dataSource and delegate methods (and yes I set the delegate and dataSource to the tableView)</p>
  
  <pre><code>- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  {
      return 1;
  }
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
      return [_items count];
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"Cell";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
      }
  
      // Configure the cell...
      cell.textLabel.text = [_items objectAtIndex:indexPath.row];
  
      return cell;
  }
  </code></pre>
  
  <p>The problem is here:</p>
  
  <pre><code>    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      // Navigation logic may go here, for example:
      // Create the next view controller.
      DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
  
      // Push the view controller.
      [self.navigationController pushViewController:detailViewController animated:NO];
  
      detailViewController.detailLabel.text = [_items objectAtIndex:indexPath.row];
  }
  </code></pre>
  
  <p><code>DetailViewController</code> is a simple UIViewController:</p>
  
  <p>(yes, I set the IBOutlet on nib file)</p>
  
  <pre><code>@interface DetailViewController : UIViewController
  @property (weak, nonatomic) IBOutlet UILabel *detailLabel;
  
  @end
  </code></pre>
  
  <p>The problem is that this doesn't work on iOS7, the label in <code>DetailViewController</code> doesn't get updated. I try to set the label text before and after of <code>pushViewController</code>.</p>
  
  <p><strong>This works on all previous versions of iOS.</strong></p>
  
  <p><strong>Why is not working on iOS 7 ??</strong></p>
  
  <p>The only way I get this working is, like I saw on <a href="https://stackoverflow.com/a/18990719/810661">this other question</a>:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      // Navigation logic may go here, for example:
      // Create the next view controller.
      DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
  
      // Push the view controller.
      [self.navigationController pushViewController:detailViewController animated:YES];
  
      dispatch_async(dispatch_get_main_queue(), ^{
          detailViewController.detailLabel.text = [_items objectAtIndex:indexPath.row];
      });
  }
  </code></pre>
  
  <p><strong>Can somebody help me out to understand what is going on here??</strong> </p>
  
  <p>Thanks!</p>
  
  <p>_</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>it also works like this:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      // Navigation logic may go here, for example:
      // Create the next view controller.
      DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
  
      // Push the view controller.
      [self.navigationController pushViewController:detailViewController animated:YES];
  
      if (detailViewController.view) {
          // do notihing
      }
      detailViewController.detailLabel.text = [_items objectAtIndex:indexPath.row];
  }
  </code></pre>