【发布时间】:2015-09-05 11:41:50
【问题描述】:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return dict.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *simpleTableIdentifier = @"RestaurantResultsCell";
RestaurantDetailsViewCell *cell = (RestaurantDetailsViewCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle]loadNibNamed:@"restaurantDetailsCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
arrResponse =[NSArray arrayWithObject:dict];
arr = [arrResponse objectAtIndex:0];
dictio = [arr objectAtIndex:0];
cell.cusineRestLabel.text = [[dictio valueForKey:@"restaurant_name"]objectAtIndex:indexPath.row];
NSLog(@"cell is %@",cell.cusineRestLabel.text);
// cell.cusineRestLabel.text = [dic objectForKey:@"restaurant_name"];
cell.cusineRestAddress.text = [dictio valueForKey:@"restaurant_streetaddress"];
NSLog(@"cell is %@",cell.cusineRestAddress.text);
cell.cusineDeliveryTime.text = [dictio valueForKey:@"restaurant_delivery"];
NSLog(@"cell is %@",cell.cusineDeliveryTime.text);
return cell;
}
第一次执行后[__NSArrayI 长度]:无法识别的选择器发送到实例
【问题讨论】:
-
真的吗?你的问题在哪里?编辑您的问题并以适当的方式提问。
-
重新格式化代码,提出问题,提供有用的错误解释(在哪一行),努力!
-
返回单元格后,控件进入封闭括号,然后它应该上升并重新执行所有行但崩溃
-
哈哈哈,什么?你读过我们的 cmets 吗?
-
不要使用字典作为数据源。由于字典是无序的,因此您将按随机顺序获取项目。
标签: ios objective-c uitableview unrecognized-selector