2013-07-24 5 views
0

보기 컨트롤러 내에 UITableView가 있습니다. 헤더가 표시되고 헤더 텍스트는 표시되지만 셀 텍스트는 표시되지 않기 때문에 매우 이상합니다. 이 라인셀 텍스트가 표시되지 않습니다. -UITableView

table.dataSource = self; 

이 방법을 추가

- (void)viewDidLoad 
{ 

table.delegate = self; 
selection= [[NSMutableArray alloc] init]; 

[selection addObject:@"text"]; 
[selection addObject:@"text"]; 
[selection addObject:@"text"]; 
...} 
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 
// configure the cell in each row 

static NSString *CellIdentifier = @"Cell"; 
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
if (cell == nil) { 
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease]; 
} 
NSString *cellValue = [selection objectAtIndex:indexPath.row]; 
cell.textLabel.text = cellValue; 
// cell.textColor=[UIColor blackColor]; 
    return cell; 
} 

답변

1

시도 cellForRowAtIndexPath을 포함한 모든 테이블 뷰 데이터 소스 방법 (:) 너무 오래 클래스는 UITableViewDataSource 프로토콜을 준수로 불린다.

관련 문제