我在我使用的tableView顯示的數據,但問題是,它並沒有顯示的tableView數據這裏是設置單元格的值的UITableView不顯示在iPad上的應用程序數據
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier] autorelease];
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
}
if (tableView == tableCategory) {
cell.textLabel.font=[UIFont fontWithName:@"Arial" size:16];
cell.textLabel.textAlignment=UITextAlignmentLeft;
ObjectData*theCellData = [categoryArray objectAtIndex:indexPath.row];
cell.textLabel.text=theCellData.categoryTitle;
return cell;
}
else if (tableView == tableSubCategory)
{
cell.textLabel.font=[UIFont fontWithName:@"Arial" size:16];
cell.textLabel.textAlignment=UITextAlignmentLeft;
ObjectData*theCellData = [subCategoryArray objectAtIndex:indexPath.row];
NSString *test = theCellData.subCategoryTitle;
NSLog(@"Test Cell is %@",test);
cell.textLabel.text = test;
return cell;
}
else if(tableView == tablePublish)
{
cell.textLabel.font = [UIFont fontWithName:@"Arial" size:16];
cell.textLabel.textAlignment = UITextAlignmentLeft;
GetPublishData *theCellData = [publishArray objectAtIndex:indexPath.row];
NSString *test = [NSString stringWithFormat:@"%@:%@:%@ in:%@:%@",theCellData.UserName,theCellData.ContentTitle,theCellData.ContentType,theCellData.Catgeory,theCellData.SubCategory];
NSLog(@"Test Cell is %@",test);
cell.textLabel.text = test;
cell.detailTextLabel.text = theCellData.ContenAddedTime;
return cell;
}
else
{
cell.textLabel.font = [UIFont fontWithName:@"Arial" size:16];
cell.textLabel.textAlignment = UITextAlignmentLeft;
GetPublishData *theCellData = [publishArray objectAtIndex:indexPath.row];
NSString *test = theCellData.ContentDescription;
cell.textLabel.text = test;
return cell;
}
}
我的代碼的iPad應用程序有tableView委託和dataSource但仍然沒有顯示任何東西,而檢查計數陣列它顯示的項目,但不顯示數據在tableview 我顯示的數據其他表不工作
您可以編輯您的問題,並顯示你的整個方法' - (UITableViewCell的*)的tableView:(UITableView的*)的tableView的cellForRowAtIndexPath:(NSIndexPath *)indexPath' – zbMax
@zbMax編輯請檢查代碼 –
是否調用過表視圖方法? – Wain