我正在尝试使用 JSONKit 库并将源文件包含在我的项目中。我已包含 JSONKit.h 标头,以便包含的类别为 NSDictionary 对象提供 JSONData 和 JSONString 选择器。
NSMutableDictionary* root = [NSMutableDictionary dictionary];
[root setValue:@"CONNECT" forKey:@"command"];
NSData* data = [root JSONData];
但在运行时我收到以下错误:
-[__NSCFDictionary JSONString]: unrecognized selector sent to instance 0x784b870
为什么类别没有向 NSDictionary 对象添加适当的方法?