- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.numberOfRows; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *cellID; ... else if ([indexPath row] == 5) { cellID = @"rowFive"; } else if ([indexPath row] >= self.myNum && [indexPath row] <= self.myNum) { cellID = @"rowSix"; } else if ([indexPath row] == self.myNum + 1) { cellID = @"rowSeven"; } else if ([indexPath row] == self.myNum + 2) { cellID = @"rowEight"; } customCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath]; if (cell == nil) { cell = [[customCell alloc] init]; } return cell; } - (IBAction)addRow:(id)sender { self.myNum ++; self.numberOfRows ++; [self.myTableView reloadData]; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)