title: Comparing row count and indexpath.row
body: <p>Hi this is something very simple but is killing me for some reason.</p>
  
  <p>I want to compare the indexPath.row to the total number of rows:</p>
  
  <pre><code>NSInteger *rowCount = (NSInteger *) [self.tableView numberOfRowsInSection:indexPath.section];
  
  if((NSInteger *)indexPath.row &lt; rowCount - 1) {
      //do a
  } else {
      //do b
  }
  </code></pre>
  
  <p>but for some reason this isn't working. Is there a correct way of doing this?</p>