Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>if you look at the if else section it shows that the first row is an "sessionCell" and all other rows are "infoCells" what i think you want to do is make the first row an sessionCell, the second row an infoCell and all of the other rows peopleCells</p> <pre><code>- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.people count] + 2; // Added two for sessionCell &amp; infoCell } //inside cellForRowAtIndexPath if(indexPath.row == 0) { cell = [tableView dequeueReusableCellWithIdentifier:@"sessionCell"]; } else if (indexPath.row == 1 { cell = [tableView dequeueReusableCellWithIdentifier:@"infoCell"]; } else { cell = [tableView dequeueReusableCellWithIdentifier:@"personCell"]; Person *person = [self.people objectAtIndex:index.path.row - 2]; } ... return cell; </code></pre> <p>Better yet, I would try to make two different sell sections, one for info and one for people</p> <pre><code>- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 2; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return section == 0 ? 2 : self.people.count } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell = nil; if (indexPath.section == 0) { if(indexPath.row == 0) { cell = [tableView dequeueReusableCellWithIdentifier:@"sessionCell"]; // configure session cell } else if (indexPath.row == 1 { cell = [tableView dequeueReusableCellWithIdentifier:@"infoCell"]; // configure info cell } } else { cell = [tableView dequeueReusableCellWithIdentifier:@"infoCell"]; Person *person = [self.people objectAtIndexPath:indexPath.row]; // configure person cell } 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.
    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