title: tableView:dequeueReusableCellWithIdentifier issues with "global" constant
body: <p>Save my hair, please or point out my (obvious) error. I am trying to use a UITableViewStyle of <code>UITableViewCellStyleSubtitle</code> in a subclassed UITableViewController.</p>
  
  <p>I define a static constant in the implementation: </p>
  
  <pre><code>static NSString * const kAHCellIdentifier;
  </code></pre>
  
  <p>In <code>viewDidLoad</code> I register a tableView class:</p>
  
  <pre><code>[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kAHCellIdentifier];
  </code></pre>
  
  <p>Then in <code>tableView:cellForRowAtIndexPath</code> I initialise the the cell as follows:</p>
  
  <pre><code>UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kAHCellIdentifier];
  if (cell == nil) {
      cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kAHCellIdentifier];
  }
  </code></pre>
  
  <p>When running the app (device or sim) the cells load but the detailTextLabel doesn't show, however if I initialise like this, it works correctly*</p>
  
  <p>My guess is that the constant is not actually static, or that there is a bug (8.0.2), or there is something that I am missing completely due to lack of sleep or whatever. </p>
  
  <p>It can also be noted, that if I don't register the class there is a compiler error (expected) but no error even though the cell identifiers are different (which I guess is expected as I could register different classes for different cell styles.</p>
  
  <p>What am I missing?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Using <code>[tableView dequeueReusableCellWithIdentifier:kAHCellIdentifier forIndexPath:indexPath];</code> has no effect either.</p>
  
  <p><strong>Shorter question</strong></p>
  
  <p>Why does the <code>dequeueReusableCellWithIdentifier</code> return nil and thus initiate the cell using the UITableViewCellStyle in the <code>cell == nil</code> block if I use a static NSString in the <code>cellForRowAtIndexPath</code> method call, and not, if I use a class level global constant as defined above.</p>
  
  <p><strong>Additional</strong></p>
  
  <p>Some more testing has yielded some different results. If you register a class for the cell reuse identifier and then give the cell a different identifier in <code>cellForRowAtIndexPath</code> then it works. If you give it the same name as the registered class, then it doesn't work as expected.</p>
  
  <p><strong>Answer</strong></p>
  
  <p>After some testing, and @MANIAK_dobrii's answer, some clarity.</p>
  
  <p>If you want to use the newer cell dequeue method <code>dequeueReusableCellWithIdentifier:forIndexPath</code> and need to use a <code>UITableViewCellStyle</code> other than default, you'll need to subclass <code>UITableViewCell</code> and override the tableview style in the <code>initWithStyle</code> method call.</p>
  
  <p>If you are happy to use the older method then make sure you don't register a class for the reuse identifier otherwise it will not work.</p>