即時通訊iOS開發新增功能。 這是一個小餐廳類型的應用程序。取決於餐廳,它將填充促銷活動。 我已經完成了迄今所有的工作,並獲得了在viewdidLoad方法中的數組提升列表。將dbmanager數據填充到UITableView
if (!dbmanager)dbmanager = [[DBManager alloc]init];
array = [dbmanager getPromotions:[NSNumber numberWithInt:restId]];
NSLog(@"%lu", (unsigned long)array.count);
,並使用這個我能得到推廣詳情細節到日誌
for (PromotionTbl *order in array) {
NSLog(@"%@",order.promoName);
}
我想填充在tableview中這些數據,所以我也做了的tableview正常implemantation和
加像這樣的細胞
cell.textLabel.text = [[array objectAtIndex:indexPath.row]objectForKey:@"promoName"];
但即時通訊錯誤說
2015-11-16 11:20:35.825 Eatin[2858:1201859] -[PromotionTbl objectForKey:]: unrecognized selector sent to instance 0x7ffb507b3ab0 2015-11-16 11:20:35.834 Eatin[2858:1201859] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PromotionTbl objectForKey:]: unrecognized selector sent to instance 0x7ffb507b3ab0'
無我有objectForKey
要做的事。
非常感謝。有效。 –
,你能告訴我如何將圖像分配給該單元?在tableView中有Image作爲'order.promotionImage' –
@Cade參見編輯答案 – VRAwesome