Hey guys, so I have this code:
SJLog(@"dict: %@",dict);
That prints this dictionary:
2011-05-04 02:37:51.537 Parking[14458:207] dict: {
"A_SPACES" = 0;
"DP_SPACES" = 7;
"LOT_DESC" = "West of the Maddy Lab off of West Health Science Dr.";
"LOT_ID" = 44;
"LOT_NAME" = LOT57;
"L_SPACES" = 0;
"MC_SPACES" = 8;
"VISITOR_SPACES" = 263;
"permits_accepted" = {
A = 1;
C = 1;
L = 0;
};
}
And I am trying to retrieve the value for LOT_DESC via the following code:
SJLog(@"lot description from dict: %@ ",[dict objectForKey:@"@LOT_DESC"]);
But I get this:
2011-05-04 02:37:51.537 Parking[14458:207] lot description from dict: (null)
And if I use [dict valueForKey:@"@LOT_DESC"] I get the following error:
2011-05-04 02:44:28.148 Parking[14505:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<__NSCFDictionary 0x58c8660> valueForUndefinedKey:]: this class is not key value coding-compliant for the key LOT_DESC.'
Accessing the dictionary via valueForKey for all numeric values works fine. So, I have no idea what is going wrong and would really love some advice. Thanks in advance!
Try this