我正在创建一个看起来像这样的 JSON 字符串:
{ "request_type":"send_string", "security_level":0, "device_type":"ios", "blob":{"string":"blah"}"}
这就是我所做的:
NSDictionary *requestData = [NSDictionary dictionaryWithObjectsAndKeys:
@"send_string",@"request_type",
[NSNumber numberWithInt:0],@"security_level",
@"ios",@"device_type",
//No Email Provided, This is just for testing
blobData,@"blob",
nil];
NSData *JSONRequestData = [NSJSONSerialization dataWithJSONObject:requestData options:kNilOptions error:&error];
当我用 NSLog 打印出来时,我得到
{"security_level":"0","request_type":"send_string","device_type":"ios","blob":{"string":"hello"}}
它出现故障......什么给了?