0
我剛剛在我的故事板中添加IBOutlet
到我的UIImageView
,現在我的自定義TableViewCell
不再有效。添加IBOutlet並自定義TableViewCell不再工作
2012-08-13 13:30:28.052 Project[6189:fb03] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<TableViewController 0x808ab80> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key imageView.'
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"CustomCell";
static NSString *CellNib = @"CustomCell";
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:CellNib owner:self options:nil];
cell = (CustomCell *)[nib objectAtIndex:0];
}
...
}
有什麼建議嗎?
我的TableViewCell是自定義的。更高,10張標籤,4張照片。 UILabel Outlets正在工作。 UIImageView不是。這是我的問題。 – jussi 2012-08-13 12:34:21
對不起,我誤解了你的情況。現在我展示了我的應用程序的一部分。我希望這對你有所幫助。 – weed 2012-08-13 12:37:50
謝謝你的工作。 但我仍然不明白爲什麼我不能使用IBOutlet的UIImageView。這令人困惑 – jussi 2012-08-13 12:42:15