title: Why do my switch cases sometime need braces in Objective-C?
body: <p>Sometimes Xcode will show an error "<em>Expected expression</em>" on the line after a case. For example, Xcode is pointing to <em>UserContentViewController</em> with a red arrow:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      switch (indexPath.row) {
          case IndexVideo: 
              UserContentViewController* detailViewController = [[UserContentViewController alloc] initWithUser:self.user];
              [self.navigationController pushViewController:detailViewController animated:YES];
              break;
  
      }
  }
  </code></pre>
  
  <p>If I put braces around my case, the error is gone. Firstly, I want to know what is the problem with not using braces. I've never used braces in cases in any other language. Secondly, why does Xcode only complain about my cases on rare occasions? I can't quite discern what type of code triggers this error.</p>