I have a variable called attending being pulled from a JSON feed. After checking what class type the object is being interpreted as I NSLog this:
attending var type is: __NSCFBoolean
This is done using [varname class] to get the class type of the variable.
So I want to see if this is true or false…. so I write this code..:
if([[_events objectAtIndex:indexPath.row] objectForKey:@"attending"] == YES){
However I cant compile it because it gives me a yellow text error saying this:

What am I doing wrong? How can I fix this. Just to add the data in the feed looks like this:
{
attendees = (
);
attending = 1;
date = "2012-09-24 09:11:00";
id = 504;
lessonHTML = "somehtml.";
name = "Sup";
youtubeId = "http://www.youtube.com/watch?v=j1vb4cND3G0";
},
{
attendees = (
);
attending = 1;
date = "2012-09-24 09:11:00";
id = 503;
lessonHTML = "somehtml.";
name = "Sup";
youtubeId = "http://www.youtube.com/watch?v=j1vb4cND3G0";
},
{
attendees = (
);
attending = 0;
date = "2012-09-24 09:11:00";
id = 508;
lessonHTML = "somehtml.";
name = "Sup";
youtubeId = "http://www.youtube.com/watch?v=j1vb4cND3G0";
},
{
attendees = (
);
attending = 1;
date = "2012-09-24 09:11:00";
id = 509;
lessonHTML = "somehtml.";
name = "Sup";
youtubeId = "http://www.youtube.com/watch?v=j1vb4cND3G0";
},
{
attendees = (
);
attending = 0;
date = "2012-09-24 09:11:00";
id = 505;
lessonHTML = "somehtml.";
name = "Sup";
youtubeId = "http://www.youtube.com/watch?v=j1vb4cND3G0";
},
{
attendees = (
);
attending = 1;
date = "2012-09-24 09:11:00";
id = 506;
lessonHTML = "somehtml.";
name = "Sup";
youtubeId = "http://www.youtube.com/watch?v=j1vb4cND3G0";
},
Boolean in dictionary and other container classes are encapsulated in
NSNumberobjects (see theNSNumberdocumentation for more info)To extract the value you need to send the
boolValuemessage to the object retrieved from the dictionary and compare it to YES/NO:Read more about values and how they are encapsulated I collection classes in the Apple documentation here