I am using Xcode 5 , I write this method but unfortunately this error appear: USE OF UNDECLARED IDENTIFIER otherCard. Although I declare it in the for loop:
- (void)chooseCardAtIndex:(NSUInteger)index{
card *card =[self cardAtIndex:index];
if(card.isMatched){
if(card.isChosen){
card.chosen =NO;
}else {
for(card *otherCard in self.cards){
if(otherCard.isChosen && !otherCard.isMatched){
int matchScore =[card match:@[otherCard]];
if(matchScore){
self.score +=matchScore;
} else {
self.score -= MISMATCH_PENALTY;
}
}
}
}
}
}
thank you in advance