我在我的應用程序中使用自定義單元格(friendListCell)。當我運行這個IOS 8後來它工作,但在IOS 7它崩潰並顯示如下錯誤。我無法找出錯誤的地方存在,應用程序崩潰IOS 7工作IOS 8
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UILabel 0x17892a10> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key keyPath.'
下面的代碼,
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
return cell;
}
注: 我刪除所有的引用,即使它會顯示錯誤這種細胞。
向我們展示一些代碼,並指出崩潰發生的位置。請注意,您可能需要啓用異常斷點來查看觸發異常的原因。 – jcaron
您可能試圖設置文本而不引用Label的文本屬性...您必須在某處執行'lblTitle = @「data」'而不是'lblTitle.text = @「data」'.. – Dalvik
請參閱我的更新代碼和斷點顯示錯誤,當涉及到下面的行,單元格= [tableView dequeueReusableCellWithIdentifier:@「cell」forIndexPath:indexPath]; –