If I’m grabbing the data in a plist using:
NSString *path = [[NSBundle mainBundle] pathForResource:@"Providers" ofType:@"plist"];
dataArray = [NSMutableArray arrayWithContentsOfFile:path];
for (NSDictionary *dictionary in dataArray)
{
text = [dictionary valueForKey:@"text"];
checked = [dictionary valueForKey:@"checked"];
NSLog(@"%@ checked value is: %@", text, checked);
}
How might I go about writing a conditional statement that checks to see only if checked is set to YES and if so output the text value of the providers
Assuming that
checkedis stored as aBOOLwrapped inNSNumber*, you can use this code:* You wrap a
BOOLinNSNumberby calling[NSNumber numberWithBool:myBoolValue].