SOffer[26229:c07] current Product: (
{
id = 20;
image = "img2.png";
name = "offer 2";
}
)
我有通过 NSLog 打印时产生上述结果的产品,我需要单独打印这些。以下代码生成此
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
如果(细胞 == 零){
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
}
NSString *currentProductName;
currentProductName = [productKeys objectAtIndex:indexPath.row];
currentProduct = [products objectForKey:[productKeys objectAtIndex:indexPath.row]];
NSLog(@"当前产品:%@",currentProduct);
//currentProductName = [currentProduct objectForKey:@"image"];
//当前产品 = [当前产品];
[[单元格文本标签] setText:currentProductName];
返回单元格;
}
currentProduct 被声明为 NSArray 但是当我尝试使用 objectForKey 打印时,它说 No visible interface for NSArray 声明了选择器 ObjectForKey