title: Can I declare variables inside an Objective-C switch statement?
body: <p>I think I'm going blind, because I can't figure out where the syntax error is in this code:</p>
  
  <pre><code>if( cell == nil ) {
      titledCell = [ [ [ TitledCell alloc ] initWithFrame:CGRectZero
          reuseIdentifier:CellIdentifier ] autorelease
      ];
  
      switch( cellNumber ) {
          case 1:
              NSString *viewDataKey = @"Name";
  etc...
  </code></pre>
  
  <p>When I try to compile it, I'm getting an <em>Error: syntax error before '*' token</em> on the last line.</p>
  
  <p>Sorry for such a basic question, but what am I missing?</p>