New to Objective-C. I can build my app successfully but then I get the following error:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key cardButton.'
I checked each button on the page with the connection inspector and I didn't see any warnings. I may have added a connection and then deleted it incorrectly so it's still somewhere in the background, is there a way to see all connections?. I'm not really sure.
@property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *cardButtons;
- (void)updateUI
{
for (UIButton *cardButton in self.cardButtons) {
int cardIndex = [self.cardButtons indexOfObject:cardButton];
Card *card = [self.game cardAtIndex:cardIndex];
[cardButton setTitle:[self titleForCard:card]
forState:UIControlStateNormal];
[cardButton setBackgroundImage:[self backgroundImageForCard:card]
forState:UIControlStateNormal];
cardButton.enabled = !card.isMatched;
}
self.scoreLabel.text = [NSString stringWithFormat:@"Score: %d", self.game.score];
}