Suppose you have a NSDictionary* instance called temp. You've setup everything including the plist. The plist consists of: KeyName ValueType numKey0 NSNumber strKey1 NSString strKey2 NSString strKey3 NSString strKey4 BOOL+ <code_fragment_begins>
[self setKey0:[temp objectForKey:@"numKey0"]]; [self setKey1:[temp objectForKey:@"strKey1"]]; [self setKey2:[temp objectForKey:@"strKey2"]]; [self setKey3:[NSMutableString stringWithString:(NSMutableString *)[temp objectForKey:@"strKey3"]]]; <code_fragment_ends>
Now the question. How do I reference the BOOL? If I try the following: BOOL widget = @(BOOL *)[temp objectForKey:@"strKey4"]; I get a bad value. If I try anything with the RHS set to: (BOOL*)[temp objectForKey:@"strKey4"]; I get a warning: invalid receiver type 'BOOL *'
I also tried BOOL widget = [temp boolValueForKey:@"strKey4"];
I got a warning saying: 'NSDictionary' may not respond to '-boolForKey:'
BTW all the other key values are passed correctly except the BOOL.
So...flummoxed! Suggestions? TIA ClarkW |