"unable to dequeue a cell with identifier" only on iPadOS 15.0

I have a UITableView based up. It is running fine on all iOS versions including 15.0. It is also running fine on all iPadOS versions up to 14.x. But only on iPadOS 15.0 it crashes with the following error message:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier TextCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'

Is this a know issue? How can I debug it to figure out where the problem lies?

Note that I actually do register the NIB as follows in viewDidLoad:

static NSString *reuseIdentifierTextCell = @"TextCell";

[self.tableView registerNib:[UINib nibWithNibName:@"ChatTextCellCondensed" bundle:nil] forCellReuseIdentifier:reuseIdentifierTextCell];

It is crashing at this line in cellForRowAtIndexPath:

cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifierTextCell forIndexPath:indexPath];

Thanks!

  • Just an idea: have you checked the name of Nib is the exact one ? But if it works on iOS and not iPadOS 15 exclusively, that's unlikely the problem. Have you created different targets for iOS and iPadOS ? If so, maybe the cell is not referenced in the iPad target ? Did you file a bug report ?

Add a Comment

Replies

The app is a universal app with just one target.

I did open a code level technical support request for this issue.

I can work around it with this crazy piece of code:

@try {
  cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifierTextCell forIndexPath:indexPath];
} @catch(id exception) {
  NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"ChatTextCellCondensed" owner:self options:nil];
  cell = [topLevelObjects objectAtIndex:0];
}

Looking at your solution, seems it needs to find in mainBundle.

Did you try:

[self.tableView registerNib:[UINib nibWithNibName:@"ChatTextCellCondensed" bundle: [[NSBundle mainBundle]]     // I'm not sure of the objC syntax, but that's the idea
forCellReuseIdentifier:reuseIdentifierTextCell];
  • Thanks for the input, it didn't help unfortunately. I should probably also mention that on the initial load of the cells it is working fine even on iPadOS 15.0. But then when a reload gets triggered due to another view becoming active the crash happens.

Add a Comment

Same issue here. Since I updated my iPad to iOS 15, developing with it became very confusing and sometimes impossible like right now. Did you receive code level support and found a solution?

Unfortunately there was no solution, I'm still running with the try/catch workaround as shown above.