尝试将 JSON 字符串转换为对象
NSString *testString = @"OMJ=\"N.A.\"&SPJ=\"N.A.\"&OBJ=\"N.A.\"";
NSMutableDictionary *tags = [NSMutableDictionary new];
tags = [NSMutableDictionary dictionaryWithDictionary:[Utility convertJSONStringToObject:testString]];
错误信息!
-[__NSCFConstantString objectFromJSONString]: unrecognized selector sent to instance!
使用 NSJSONSerialization 后,字典 JSON 的 retun 值为 null 空
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [@"OMJ=\"N.A.\"&SPJ=\"N.A.\"&OBJ=\"N.A\"" dataUsingEncoding:NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: nil];
我在代码中做错了什么。任何人都建议我解决这个问题。
@提前致谢