I need to extract some info from a number of strings in infoArray. The layout for each element in infoArray looks like @”NO,YES,YES,YES,YES,NO,NO,YES”, etc.
When I use the following:
[splitArray setArray:[[infoArray objectAtIndex: i] componentsSeparatedByString:@","]];
I can access whatever I need in the new splitArray with something like:
NSLog(@"Result = %@", [infoArray objectAtIndex: 0]);
and in this case it will print out correctly. The problem is when I need to use it next for conditions:
if([infoArray objectAtIndex: 0] == @"YES"){
//do something
}
The above code obviously doesn’t work even if the value was “YES”. I believe the typecast is wrong. I’m a bit of a newbie. Any suggestions?
You should modify your question with the additional data instead of answering your own question.
To answer your question, use: