我收到錯誤,如*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The NIB data is invalid.'
'NSInternalInconsistencyException',原因:'NIB數據無效'。對於CustomCell
對於iOS 5.0,即使我取消了自動版式,併爲所有版本的iOS爲customcell部署支持。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CustomCellIdentifier = @"GroupListCell";
GroupListCell *cell = (GroupListCell *)[tableView dequeueReusableCellWithIdentifier: CustomCellIdentifier];
if (cell == nil)
{
NSArray *nib;
if(UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad)
{
nib= [[NSBundle mainBundle] loadNibNamed:@"GroupListCell" owner:self options:nil];
}
else{
nib= [[NSBundle mainBundle] loadNibNamed:@"GroupListiPhoneCell" owner:self options:nil]; // sigabrt
}
// cell implementation code..
}
}
此代碼適用於iOS6.0,但不適用於iOS 5.0。
問題是什麼?我錯過了什麼。
我會嘗試 – KDeogharkar 2013-02-22 07:11:30
不能正常工作,它只會將sigabrt放在上面,以避免您添加的特定行。 – KDeogharkar 2013-02-22 07:13:10
把一個異常斷點,並檢查確切地得到錯誤的地方 – 2013-02-22 07:16:31