我被传递了 NSstring 它正在正确地将数据输入到 uitableview 但是当我解析整数值时它显示异常由于未捕获的异常而终止应用程序'NSInvalidArgumentException', reason: -[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0x744e9d0
这是我的代码
(void)fetchedData:(NSData *)responseData {
//parse out the json data
NSError* error;
NSDictionary* json = [NSJSONSerialization
JSONObjectWithData:responseData options:kNilOptions error:&error];
NSArray * values=[json objectForKey:@"loans"];
NSLog(@"Array: %@",values);
for (NSDictionary *file in values)
{
NSNumber *fileTitle=[file objectForKey:@"id"];
// NSString *fileTitle = [file objectForKey:@"sector"];
[titles addObject: fileTitle];
}
[self.mainTableView reloadData];
}