Reputation: 4716
Why this error? I think that I has closed all brackets. This is the code:
int i=0;
while(i<count){
if([[ageMatch rangeOfString:age].location != NSNotFound] && [[glassesSex rangeOfString:gender].location !=NSNotFound] && [[faceMatch rangeOfString:shape].location != NSNotFound] ){ //Expected identifier
[arrayNuovo insertObject:dictionary atIndex:i];
}
i++;
}
Upvotes: 0
Views: 103
Reputation: 11026
use this code
while(i < count){ if(([ageMatch rangeOfString:age].location != NSNotFound) && ([glassesSex rangeOfString:gender].location !=NSNotFound) && ([faceMatch rangeOfString:shape].location != NSNotFound) ){ //Expected identifier [arrayNuovo insertObject:dictionary atIndex:i]; } i++; }
Upvotes: 0
Reputation: 21221
you should change
if([[ageMatch rangeOfString:age].location != NSNotFound] && [[glassesSex rangeOfString:gender].location !=NSNotFound] && [[faceMatch rangeOfString:shape].location != NSNotFound] )
To
if([ageMatch rangeOfString:age].location != NSNotFound &&
[glassesSex rangeOfString:gender].location !=NSNotFound &&
[faceMatch rangeOfString:shape].location != NSNotFound )
When you do a boolean test, you do it like [string rangeOfString:age].location != NSNotFound
and dont include them in [ and ]
Upvotes: 2