【发布时间】:2013-02-22 06:58:14
【问题描述】:
我收到错误,例如*** 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。
问题是什么?我错过了什么吗?
【问题讨论】:
标签: iphone ios xcode ios5 ios6