Вы можете сделать это следующим образом.
перенастроить номер строки, как показано ниже.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [array count]+2;
}
После этого выполните это в методе cellRowAtindexPath, как показано ниже:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
[tableView setPagingEnabled:NO];
//[tableView setSeparatorColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"longDotedLine.png"]]];
if (indexPath.row < [array count]) {
cell.textLabel.text = @"Test Data";
} else {
cell.textLabel.text = @"";
}
return cell;
}
Попробуйте, может быть, это поможет вам.
Спасибо, MinuMaster.