我收到类似的错误
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The NIB data is invalid.'
iOS 5.0
即使我取消选中 AutoLayout 并为 customcell 的所有版本的 iOS 提供部署支持。
- (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。
问题是什么?我错过了什么吗?