Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If it's always at the end, you might consider using the footer view of the UITableView. You can then keep some extra logic out of your UITableViewDataSource.</p> <p>If it HAS to be as a cell, you'd have to add an extra row count on your last section, then do an if statement check to watch out for it in your -tableView:cellForRowAtIndexPath: implementation. I would strongly urge you try the footer approach, as it's cleaner and way easier to figure out what you were doing a few months/years from now.</p> <p>Here's some code. Note you'd need to make another section if you are using grouped style in the UITableView.</p> <pre><code>- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (section == sections.count - 1) //Looking for last section { return [sections objectAtIndex:section].count + 1; //Add one to the last section } return [sections objectAtIndex:section].count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSInteger row = indexPath.row; if ((sections.count == indexPath.section) &amp;&amp; [sections objectAtIndex:indexPath.section].count == indexPath.row) { //Here you would create and return your UITableViewCell } PLContactCell *cell = [tableView dequeueReusableCellWithIdentifier:[PLContactCell reuseIdentifier]]; if (!cell) { cell = [PLContactCell reusableCell]; cell.delegate = self; } id modelObject = [[sections objectAtIndex:indexPath.section] objectAtIndex:indexPath.row]; if ([modelObject isKindOfClass:[NSString class]]) { [cell configureWithString:modelObject]; } else { [cell configureWithUser:modelObject]; } return cell; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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