尝试设置值/键对时出现以下错误:
2011-06-21 16:21:16.727 agent[94408:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SBJsonWriter 0xab31230> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key key.'
这是代码:
SBJsonWriter *writer = [[SBJsonWriter alloc] init];
[writer setValue:@"val" forKey:@"key"];
NSString *json = [writer JSONRepresentation];
NSLog([NSString stringWithFormat:@"json: @%", json]);