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;
}