Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSUInteger row = [indexPath row]; NSUInteger count = [rows count]; UITableViewCell *cell = nil; if (row == count) { // This is the bottom most cell, therefore display the More-Cell static NSString *postCellId = @"moreCell"; cell = [self.tableView dequeueReusableCellWithIdentifier:postCellId]; if (cell == nil) { // it cannot be re-used, so create a new one cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:postCellId]; // now add all sub views such as labels and buttons. // If the layout is always the same then you may set it here. } // Now it is either re-used or newly created. However, it carries all the subviews. // Here set the values. You may set the layout here too, if the layout depends on data. } else { // Display a regular Post-Cell static NSString *postCellId = @"postCell"; cell = [self.tableView dequeueReusableCellWithIdentifier:postCellId]; if (cell == nil) { // it cannot be re-used, so create a new one cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:postCellId]; // now add all sub views such as labels and buttons. // If the layout is always the same then you may set it here. } // Now it is either re-used or newly created. However, it carries all the subviews. // Here set the values. You may set the layout here too, if the layout depends on data. } return cell; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload