0
我有一個方法如下使用糾正的Json問題與調用功能
+(NSString *)CorrectJsonForEmptyValues:(NSString *)pasRawJson
{
NSLog(@"CorrectJsonForEmptyValues");
NSMutableString *tmpJson = [pasRawJson mutableCopy];
[tmpJson replaceOccurrencesOfString:@"[,"
withString:@"[{\"v\": \"N/A\",\"f\":\"N/A\"},"
options:0
range:NSMakeRange(0, [tmpJson length])];
[tmpJson replaceOccurrencesOfString:@",,"
withString:@",{\"v\": \"N/A\",\"f\":\"N/A\"},"
options:0
range:NSMakeRange(0, [tmpJson length])];
NSString *correctedJson=tmpJson;
return correctedJson;
}
空值,這樣調用
result = [self performSelector:@selector(CorrectJsonforEmptyvalues:) withObject:result];
但是,讓錯誤的函數
2011-11-11 11:11:33.217 HelloWorld10[38833:207] -[Data CorrectJsonforEmptyvalues:]: unrecognized selector sent to instance 0x5725cc0
2011-11-11 11:11:33.219 HelloWorld10[38833:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Data CorrectJsonforEmptyvalues:]: unrecognized selector sent to instance 0x5725cc0'
如果任何人都可以請提供一個解決方案,這將是有益的。 在此先感謝。