So I’m trying to find a NSString that is the same as an object inside an NSArray
So i have this so far
SPButton *currentBalloon = (SPButton *)[event target];
NSUInteger x =[letterArray indexOfObject:currentLetter];
NSUInteger y =[letterArray indexOfObject:currentBalloon.info];
if (y == x) {
// do the following code
NSLog(@"Equal!");
} else {
NSLog(@"Not Equal!");
}
I keep crashing on the indexOfObject line. Anybody god any ideas?
Seems like you’re going about this in a very long winded way, getting the index of a letter in an array (presumably alphabetically ordered) then comparing indexes. Why not just compare the two letters?