由于未捕获的异常’NSInternalInconsistencyException’,我收到错误,如***终止应用程序,原因:’NIB数据无效.’
对于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.
问题是什么?我错过了什么.
解决方法
使用下图中设置的值检查nib文件
检查UILabel UIButton文本