My UITableViewCell is giving a -[UITableViewCell nameTeam]: unrecognized selector sent to instance.
I created a PlayerStatsTableViewCell.xib with a UITableViewCell and UILabel. Set the Custom Class to "PlayerStatsTableViewCell" and its Table View Cell identifier to "playerStats"
PlayerStatsTableViewCell.h
@interface PlayerStatsTableViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *nameTeam;
@end
PlayerStatsTableViewCell.m
@implementation PlayerStatsTableViewCell
@synthesize nameTeam;
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
In my PlayerStatsTableViewController, cell.nameTeam is throwing the error
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
PlayerStatsTableViewCell *cell = (PlayerStatsTableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"playerStats"];
[tableView registerNib:[UINib nibWithNibName:@"PlayerStatsTableViewCell" bundle:nil] forCellReuseIdentifier:@"playerStats"];
cell.nameTeam.text = @"PLEASE";
return cell;
}
PlayerStatsTableViewCell.xib showing Custom Class and Identifier
The error message
PlayerStatsTableViewController from Storyboard