NSInternalInconsistencyException ", Reason: 'Failed to load NIB in batch, retrieving 500+ entries from the address book database

I apologize if this question is repeated but I couldn't help it as I tried every possible solution but nothing worked and that's why I am asking this question.

I am loading nearly 500 records in my table view from the address book database in one go. If there are few records, say 50 or 100, my table displays without any problem. But when the number of entries goes, say 300+, I get a crash that says:

*** Application terminated due to unmapped exception "NSInternalInconsistencyException", Reason: "Failed to load NIB in bundle: 'NSBundle (loaded)' named 'GroupmemberCell' '

I have read some other forms that have solutions like file validation Build Phase

for file or validation of iOS app package content. I tried everything and nothing works, the file is present in build phase and also added to package content of my app file. Also, I deleted those files once, i.e. deleted them completely and created a new UITableViewCell class, but then it crashed too.

GroupmemberCell is the xib I added in my table view. Following is the code snippet from cell for datasource data 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;
            }

        }
        }
    }

What could be the problem here, how the same code works for a set of 100 records without any glitch, but fails if I select a set of 500+ records and show them in a table.

To get the records, I dont give any calls in the background, I tried it once, but then it also failed to solve the problem.

My thoughts: I think I am loading multiple data at once, which can give several problems in the main thread to build the UI, because I am getting the data in my arrays and I am validating it and then only passing the command to reload the table.

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

I have seen in many applications that they download 1000 lightning fast data - how do they do that? What is their approach or is there a best practice that I am missing, please help me.

+3


source to share


1 answer


After many brainstorming sessions and drinking lots of coffee, I used the Analyze tool to clear all memory warnings and then used the Tools tool to see if any leaks had been cleaned up. Removed derived data and cleaned up the app and I was done.

There were about 67 issues in the whole application in which the "Analysis Tool" appeared and more than 3-4 issues displayed by the "Tool Tool"



I know it might sound silly, but I figured it happened. Hope this helps someone stuck on the same issue.

0


source







All Articles