Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In the <code>indexPath</code> object you have the ability to look at the <code>row</code> and the <code>section</code> of the tableview item. At that point you can then just decide what to display, your view, some text another view, whatever as the value of the <code>cell</code>. Remember that a cell is a UIView so you can add subviews and all of that. The Apple Documents for UITableView actually have a section on how to create static cells with controllers in them as well as how to override <code>cell</code> objects with other views.</p> <p>Since everything is static, you can just check for the sections using a switch statement like this one in your regular <code>cellForRowAtIndexPath</code>:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *MyIdentifier = @"aCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:MyIdentifier] autorelease]; } switch ([indexPath section]) { case 0:{ cell.textLabel.text = @"The first section's cell"; break; } case 1:{ switch ([indexPath row]) { case 0:{ //The first row of the second section break; } case 1:{ //The second row of the second section break; } case 2:{ //The third row of the second section break; } } break; } case 2:{ //the third section break; } case 3:{ //the fourth section cell.textLabel.text = @"Notes"; cell.detailTextLabel.text = currentClient.Notes; break; } default: break; } return cell; } </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      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