Chấm dứt ứng dụng do ngoại lệ còn tự do 'NSUnknownKeyException', lý do: '[setValue: forUndefinedKey:]:. lớp này không phải là giá trị quan trọng mã hóa tuân thủ cho buttonOfFirstView chìa khóa'NSUnknownKeyException setValue: forUndefinedKey:
Tại sao tôi gặp lỗi này? Tôi đang cố gắng tạo một ô bảng mặc dù XIB. Sau khi tôi thêm mã này nó ném ngoại lệ trên.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"MyCell";
MyTableViewCell *cell = (MyTableViewCell*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *arrayCellXib = [[NSBundle mainBundle] loadNibNamed:@"MyTableViewCell"
owner:self
options:nil];
....
}
.....
return cell;
}
Cách giải quyết?
wat là buttonOfFirstView của bạn.? –
một nút bên trong ô bảng Nút IBOutlet UIButtonOfFirstView; – dayitv89
kiểm tra xem nó đã được kết nối đúng chưa –