I have created a class which is a subclass of UITableViewCell and I have also created an xib file for the same.
In the xib file I am adding a UITableViewCell and then giving it an identifier ChatCell and then in my class I am trying to use this custom cell like this
static NSString *CellIdentifier = @"ChatCell";
ChatCustomCell *cell = (ChatCustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]
You need to register your Custom Xib file in your ViewController first.
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 viewController won't be able to load the Cell Nib file, which would result in nil properties of Cell.