I have created a class which is a subclass of
static NSString *CellIdentifier = @"ChatCell";
ChatCustomCell *cell = (ChatCustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
You need to register your Custom Xib file in your ViewController first.
call this method or the registerClass:forCellReuseIdentifier: method to tell the table view how to create new cells. If a cell of the specified type is not currently in a reuse queue, the table view uses the provided information to create a new cell object automatically.
E.g. Write this line in your
viewDidLoad, after setting tableView delegate and dataSource:
[yourTableView registerNib:[UINib nibWithNibName:@"ChatCustomCell" bundle:nil] forCellReuseIdentifier:@"ChatCell"];
If you don't, your TableView won't be able to load the Cell Nib file, which would result in nil IBOutlets of Cell.