加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

iphone – ‘NSInternalInconsistencyException’,原因:’NIB数

发布时间:2020-12-14 17:18:04 所属栏目:百科 来源:网络整理
导读:由于未捕获的异常’NSInternalInconsistencyException’,我收到错误,如***终止应用程序,原因:’NIB数据无效.’ 对于iOS 5.0,即使我取消选中AutoLayout并为customcell的所有iOS版本提供部署支持. - (UITableViewCell *)tableView:(UITableView *)tableView c
由于未捕获的异常’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文本

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读