Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 4.2 "cell reuse indentifier in nib (Cell) does not match the identifier used to register the nib (ThisCell)"

I'm trying to use the new StoryBoard feature of Xcode 4.2 and keep getting this error when using a Table View with a custom cell.

cell reuse indentifier in nib (Cell) does not match the identifier used to register the nib (ThisCell)

I've set the class of my custom cell to my custom UITableViewCell class and set the Identifier to "ThisCell" in IB.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {     
static NSString *CellIdentifier = @"ThisCell";
//TableViewCell *cell = (TableViewCell*)[tableView dequeueReusableCellWithIdentifier:@"ThisCell"];
TableViewCell *cell = (TableViewCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
return cell;

I have no idea where "Cell" is coming from. Any ideas? I tried loading a custom cell in another project, and it seems to work fine, I just can't find any documentation on this error to find out what I messed up in the current project.

Thanks

like image 470
Tyler DeWitt Avatar asked Oct 17 '11 17:10

Tyler DeWitt


1 Answers

The error message states that in your nib the cell is identified as "Cell"—you need to look in the xib file that defines your custom cells for configuration of the Cell Reuse Identifier, and set that to ThisCell... Or just change ThisCell to Cell in this code.

like image 58
Duncan Babbage Avatar answered Nov 17 '22 07:11

Duncan Babbage



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!