0
最初のセクションでは50を超え、2番目のセクションでは選択したいが、tableViewでは値の表示はなく、NSlog( "%@"、self.over50 )、無反応なぜ私のtableViewに何も表示されなかった
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UITableViewCell" ];
NSArray* items = [[BNRItemStore shareStore] allItems];
self.itemsUnder50 = [[NSMutableArray alloc] init];
self.itemsOver50 = [[NSMutableArray alloc] init];
for (BNRItem *item in items) {
if (indexPath.section ==0) {
[self.itemsOver50 addObject:item];
cell.textLabel.text = [self.itemsOver50[indexPath.row] description];
NSLog(@"%@",self.itemsUnder50);
}
else if(indexPath.section == 1){
[self.itemsUnder50 addObject:item];
cell.textLabel.text = [self.itemsUnder50[indexPath.row] description];
}
}
return cell;
}
設定されたブレークポイントこの方法には、データソースとテーブルビューのデリゲートを接続し、1つのあなたのメソッド呼び出しずつチェックし、nullまたはでない項目をチェックしてくださいありません。 –
デリゲートメソッドでセクション2の番号を返しましたか? @ N.nnd – KAR
私は持っていますが、反応はありません –