我有以下问题,无法解决,也许有人知道一个窍门:)
主要对象必须是动态的,因为它可能不同......
应该调用的函数:
+ (NSArray *)parseJSONString:(NSString *)theJSONString error:(NSError **)errorPointer
正如代码已经声明的那样,我想解析 JSON。我有几个对象正在实现这个功能,这就是我使用 performSelector 方法的原因:
if ([[self.theObject class] respondsToSelector:@selector(parseJSONString:error:)]) {
NSError *parsingError = nil;
self.myObjectsCollection = [[self.theObject class] performSelector:@selector(parseJSONString:)
withObject:utf8ResponseString
withObject:parsingError];
}
utf8ResponseString 包含 JSON ...
我已经尝试了以下方法:
... withObject:&parsingError -> compile error
... withObject:[NSValue valueWithPointer:&parsingError] -> works until the value will be redirect to the parsingError -> Bad Exec
我已经搜索了一天,甚至不知道如何解决这个问题-请帮助...
谢谢和问候,马修