NSDictionary *data = @{
// when you always pass same value
@"someKey" : @YES
// if you want to pass some boolean variable
@"anotherKey" : @(someVariable)
};
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
[dic setObject:[NSNumber numberWithBool:TRUE] forKey:@"Pratik"];
[dic setObject:[NSNumber numberWithBool:FALSE] forKey:@"Sachin"];
if ([dic[@"Pratik"] boolValue])
{
NSLog(@"Boolean is TRUE for 'Pratik'");
}
else
{
NSLog(@"Boolean is FALSE for 'Pratik'");
}
if ([dic[@"Sachin"] boolValue])
{
NSLog(@"Boolean is TRUE for 'Sachin'");
}
else
{
NSLog(@"Boolean is FALSE for 'Sachin'");
}