iphone – ‘NSInternalInconsistencyException’,原因:’NIB数据无效.’对于CustomCell

前端之家收集整理的这篇文章主要介绍了iphone – ‘NSInternalInconsistencyException’,原因:’NIB数据无效.’对于CustomCell前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
由于未捕获的异常’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文本

猜你在找的Xcode相关文章