如果我有我的數據在一個NSArray中,並且我可以在我的-cellForRowAtIndexPath方法中使用NSLog數據,那麼是否有任何理由說明我無法使用以下代碼在我的UITableView中看到數據:UITableViewDataSource方法-cellForRowAtIndexPath
static NSString *simpleIdentifier = @"SimpleIdentifier";
UITableViewCell *simpleCell = [tableView dequeueReusableCellWithIdentifier:simpleIdentifier];
if (simpleCell == nil) {
simpleCell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleIdentifier];
}
NSUInteger row;
row = [indexPath row];
simpleCell.textLabel.textColor = [UIColor whiteColor];
simpleCell.selectionStyle = UITableViewCellSelectionStyleNone;
simpleCell.textLabel.text = [_categoriesArray objectAtIndex:row];
return simpleCell;
我想知道我是否錯過了「gotcha」或什麼的。我有一個popover這個數據逐字記錄,它工作正常。但是當我把它放入另一個popover時,它什麼也沒有顯示。所以我很難過!任何幫助都會很棒。謝謝。
你是否正在改變表格視圖的背景顏色? –
是的,tableview的背景顏色在我的popover中設置爲clearColor。如果有數據,tableView應該向右滾動?就像如果我搞砸了,文本和tableView顏色是相同的。該表不滾動,所以我認爲那裏沒有數據,即使我可以NSLog我的數組。 – Crystal
另一個popover是否將'dataSource'和'delegate'設置爲工作的popover的相同位置?因爲你根本沒有看到任何東西,所以我很想說它只是不知道從哪裏調用它的數據,並且這是一個容易錯過的事情 – justin