2011-02-23 2 views

답변

1

당신이 경우에 당신이 배열로 테이블을 채우기되며, 배열 WRT의 데이터 (indexPath.row -1) 인출 할 수는

1
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 

if(indexPath.row==0) 
{ 
//return blank cell; 
} 

//add cell contents 

return cell; 

} 
+0

나는 이것을했으나 배열을 삽입 할 때마다 삽입이 0 색인에서 시작된다는 단점이 있습니다. – Nitin

+0

[array objectAtIndex : indexPath.row-1] 사용 – KingofBliss

0
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 

     static NSString *CellIdentifier = @"Cell"; 

     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
     if (cell == nil) { 
      cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 
     } 

     // Configure the cell. 
     NSIndexPath *path1 = [NSIndexPath indexPathForRow:indexPath.row+1 inSection:indexPath.section]; 
     [self configureCell:cell atIndexPath:path1]; 

     return cell; 

} 

나는 그것을하지만 그것을 테스트하지 않습니다 시도해보십시오.

관련 문제