1.将字典或者数组反序列化为NSString.
NSMutableDictionary *jsonDic = [NSMutableDictionary dictionary];
NSMutableDictionary *alert = [NSMutableDictionary dictionary];
NSMutableDictionary *aps = [NSMutableDictionary dictionary];
[alert setObject:@"a msg come!" forKey:@"body"];
[aps setObject:alert forKey:@"alert"];
[aps setObject:@"3" forKey:@"bage" ];
[aps setObject:@"def.mp3" forKey:@"sound"];
[jsonDic setObject:aps forKey:@"aps"];
NSString *strJson = [jsonDic JSONString];
NSLog(@"%@",strJson);
2.将NSString反序列化为数组、字典.
NSDictionary *result = [strJson objectFromJSONString];
或者
NSDictionary *result = [dataJson objectFromJSONData];
NSLog(@"333%@",result);