my work is about `UITableView. Each time I run my project, this error appears :
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier Cell1 - must register a nib or a class for the identifier or connect a prototype cell in a storyboard
I checked a hundred times my cell identifier in my storyboard and in my code are the same.
Code (defaut code from UITableViewController
) :
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell1";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// Configure the cell...
return cell;
}
Picture of Table View Cell properties :
I created and implemented a subclass of UITableViewCell
for my cell.
Any idea why this is not working ?
Any way (line of code) to know what is the identifier of a cell ?
Thanks
Edit : Screenshot of my interface builder.
Edit 2 : Text of customCell.h
#import <UIKit/UIKit.h>
@interface customCell : UITableViewCell
@end
New error appears when I run the project :
[<choixActiviteViewController 0x7591ac0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Cell1.
choixActiviteViewController is a subclass of UITableViewController and is the custom class of Choix Activite View Controller.
question from:
https://stackoverflow.com/questions/19084274/xcode-unable-to-dequeue-a-cell-with-identifier 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…