I get some json data in my application:
NSMutableDictionary *json = [NSJSONSerialization JSONObjectWithData:jsonResponse options:NSJSONReadingAllowFragments error:nil];
NSLog(@"json :%@", json);
which registers:
json :{
"email" : "/apex/emailAttachment?documentId=00PZ0000000zAgSMAU&recipientId=003Z000000XzHmJIAV&relatedObjectId=a09Z00000036kc8IAA&subject=Pricing+Comparison"
}
This is exactly what I want.
However, when I move on to reading the email value, doing
[json objectForKey:@"email"]
I get an invalid argument exception:
Application termination due to unselected exception 'NSInvalidArgumentException', reason: '* - [NSDictionary initWithDictionary: copyItems:]: dictionary is not NSDictionary'
How can I read this value?
source
share