0

I get this error while trying to load data into my cells using a custom cell:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSObject 0x8d61570> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key nextTimeLabel.'

I read some of the solutions here regarding this error. I know it is some issue with an deleted IBOutlet , so i did the following:

  1. removed all connections and connected again with new views

  2. deleted the xib file entirely and changed the names of the xib file and the subviews

  3. I looked in the whole project(including the source file of the xib) for "nextTimeLabel" - nothing.

4.Quiting simulator/deleting the app/ clearing content

EDIT. code:

-(void)viewDidLoad
{
    [super viewDidLoad];
    UINib *nib = [UINib nibWithNibName:@"BNRCellView" bundle:nil];

    [self.tableView registerNib:nib forCellReuseIdentifier:@"BNRCells"]; //lets try to change that later

}

#pragma mark - TableView Data source methods

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    BNRCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BNRCells" ];
    NSDictionary *dic = self.courses[indexPath.row];
    cell.courseNameLabel.text= dic[@"title"];


    return cell;
}

Any other suggestions?

Yevgeni
  • 1,533
  • 17
  • 32
  • Just post a code that throws this error. – Avt Mar 21 '14 at 23:39
  • Search on the error. There are countless existing discussions on the topic. – rmaddy Mar 21 '14 at 23:48
  • possible duplicate of [This class is not key value coding-compliant for the key](http://stackoverflow.com/questions/3088059/this-class-is-not-key-value-coding-compliant-for-the-key) – Anthony Kong Mar 22 '14 at 00:08

1 Answers1

0

In the BNRCellView XIB for this cell (with registered identifier BNRCells), somewhere you have an outlet named nextTimeLabel connected to something which would seem to have the wrong class (an NSObject instance rather than what should presumably be a controller or view instance).

Check all of your class name settings and any outlet connections to the file owner.

Wain
  • 118,658
  • 15
  • 128
  • 151