NSInternalInconsistencyException',reason:'从地址簿数据库获取500多条记录时,无法加载bundle中的NIB [英] NSInternalInconsistencyException', reason: 'Could not load NIB in bundle while fetching 500+ records from the address book database

查看:168
本文介绍了NSInternalInconsistencyException',reason:'从地址簿数据库获取500多条记录时,无法加载bundle中的NIB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,如果这个问题重复,但我不能帮助,因为我尝试了每一个可能的解决方案,但没有工作,因此我问这个问题。

I am sorry if this question is getting repeated, but I could not help it since I have tried every possible solution but nothing worked and hence I am asking this question.

我从地址簿数据库中一次加载几乎500条记录在我的表视图中。如果记录很少,说50或100,我的表显示没有任何问题。但是当记录数达到300+时,我得到一个崩溃,说:

I am loading almost 500 records in my table view from the address book database at one go. If the records are few ,say 50 or 100, my table is displayed without any problem. But when the number of record goes say 300+, I get a crash which says:


***由于未捕获异常终止应用程序 NSInternalInconsistencyException',reason:'无法加载NIB在
bundle:'NSBundle

(loaded)'名称为'GroupmemberCell''

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'GroupmemberCell''

我已经读过一些其他的形式,有解决方案,例如在构建阶段中检查文件或检入iOS的包内容app。我已经尝试了一切,没有什么工作的文件是存在于生成阶段,也被添加在我的应用程序文件的包内容。我也删除了这些文件一次,即我完全删除它们并创建了一个新类UITableViewCell,但后来也存在崩溃。

I have read some other forms which have solutions like checking in the Build Phase for the file or checking in the package content of the iOS app. I have tried everything and nothing works the file is present in the build phase and also gets added in the package content of my app file. Also I have removed these files once, i.e I deleted them entirely and created a new class of UITableViewCell, but then too the crash was present.

GroupmemberCell是一个xib已添加到我的表视图中。下面是行数据源方法的单元格的代码段。

GroupmemberCell is an xib which I have added in my table view.Below is the code snippet from the cell for row datasource method.


static NSString *CellIdentifier = @"Cell";
    GroupmemberCell   *cell = (GroupmemberCell*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];;
    if (cell == nil)
    {

        NSArray *cellxibfilepath = [[NSBundle mainBundle]loadNibNamed:@"GroupmemberCell" owner:self options:nil];

        if  (cellxibfilepath)
        {

        for(id cellObjects in cellxibfilepath)
        {
            if ([cellObjects isKindOfClass:[UITableViewCell class]])
            {
                cell = (GroupmemberCell*)cellObjects;
            }

        }
        }
    }

这里的问题可能是相同的代码适用于100的记录集,没有任何崩溃,但如果我提取一组500多个记录,并在表中显示它们将导致崩溃。

What could be the problem here like the same code works for a record set of 100 without any crash but will give a crash if i fetch a set of 500+ records and display them in the table.

为了获取记录,我没有在后台给任何调用,我试过一次,但是也没有解决崩溃。

To fetch the records i am not giving any calls in the background, I have tried once but then too the crash was not solved.

我的想法:我想我一次加载大量的数据,这可能是在主线程中创建UI的几个问题,因为我在数组中获取数据,我检查它们,然后只给我命令重新加载表。 / p>

My Thoughts: I think I am loading lots of data at once which might be giving few issues in the main thread for UI creation, because I do get the data in my arrays and I check them and then only I give command to reload the table.


 if (tableReloadArray.count!=0) {
             [objtable reloadData];
        }



我在许多应用程序中看到他们加载了1000多个数据闪电速度 - 他们是怎么做的?

I have seen in many apps that they load 1000+ data lightning speed - how are they doing it? What is their approach or is there any best practice that I am missing, please guide me out.

推荐答案

经过大量的暴力冲突后,会话和喝大量的咖啡,我使用分析工具清除所有的内存警告,然后使用仪器工具,看看是否有任何泄漏也清除了他们。删除衍生数据并清理应用程序,我完成了。

After lots of brain storming sessions and drinking lots of coffees i used the "Analyse tool" cleared all the memory warnings and then used the "Instruments tool" to see if there were any leaks cleared them as well. Removed the derived data and cleaned the application and i was done.

在分析工具提出的应用程序中有大约67个问题,超过3个-4问题,仪器工具显示

There were round about 67 issues all over the application which the "Analyse tool" came up with and over 3-4 issues that the "Instrument tool" displayed

我知道这可能听起来很蠢,但我得到我的崩溃解决这样做。希望这有助于困扰同一问题的人。

I know this may sound stupid but i got my crash resolved by doing this. Hope this helps someone who is stuck in the same problem.

这篇关于NSInternalInconsistencyException',reason:'从地址簿数据库获取500多条记录时,无法加载bundle中的NIB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆