我是第一次使用 SBJson 框架,我遇到了一个大问题,下面的代码总是返回 null。NSDictionary 已正确填充(我打印了每个值!)。
NSDictionary *nsDictionary = [NSDictionary dictionaryWithObjects:values forKeys:keys];
SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
NSString *jsonString = [jsonWriter stringWithObject:nsDictionary];
NSLog(@"%@", jsonString);
我也试过这个:
NSDictionary *nsDictionary = [NSDictionary dictionaryWithObjects:values forKeys:keys];
SBJsonWriter *jsonWriter = [SBJsonWriter new];
NSString *jsonString = [jsonWriter stringWithObject:nsDictionary];
NSLog(@"%@", jsonString);