2010-06-02 8 views

답변

3

당신이 해 모든이 할 당신의 nsindexpath의 행 또는 섹션에 스위치와 해당 jQuery과 셀을 반환은 ... 유 행 1

(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 
    UITableViewCell *cell; 
    if(indexPath.row==0) 
    { 
    cell=..//tableviewcellA 
    } 
    if(indexPath.row==1) 
    cel=///tableviewcell b 
} 

에 대한 행 공 및 기타에 대한 TableViewCellA 및 TableViewCellB 하나가 말할 수 등등이 도움이되기를 바랍니다.

+0

감사합니다. 나는 하루 동안 막 다른 골목에 빠져 있었고 이것이 모두 해결책이었습니다. 감사. – Matt

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

{ 

NSString *[email protected]"MyCell"; 

if (indexpath.section==0) 

{ 
customCell1 *cell1=(customCell1 *)[tableView dequeueReusableCellWithIdentifier:identifier]; 

    if (cell1==nil) 
    { 
     NSArray *nib=[[NSBundle mainBundle]loadNibNamed:@"customCell1" owner:self options:nil]; 
     cell1=[nib objectAtIndex:0]; 
    } 
return cell1; 

} 

if (indexpath.section==1) 

{ 
customCell2 *cell2=(customCell2 *)[tableView dequeueReusableCellWithIdentifier:identifier]; 

    if (cell2==nil) 

{ 
     NSArray *nib=[[NSBundle mainBundle]loadNibNamed:@"customCell2" owner:self options:nil]; 
     cell2=[nib objectAtIndex:0]; 
    } 
return cell2; 

} 
관련 문제