以下のコードを使用してJson解析データをテーブルビューにバインドしようとすると、例外が発生します。ASIHttpRequest と Json も使用しています。
**Error details:**
webservice[2864:f803]
***
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[testViewController tableView:numberOfRowsInSection:]:
unrecognized selector sent to instance 0x6ecc4e0'
***
NSString *responseString = [request responseString];
SBJsonParser *parser=[[SBJsonParser alloc]init];
NSDictionary *obj=[[NSDictionary alloc]init];
obj=[parser objectWithString:responseString error:nil];
return obj.count;
NSString *responseString = [request responseString];
SBJsonParser *parser=[[SBJsonParser alloc]init];
NSDictionary *obj=[[NSDictionary alloc]init];
obj=[parser objectWithString:responseString error:nil];
NSMutableArray *statuses = [[NSMutableArray alloc]init];
for (NSDictionary *status in obj)
{
[statuses addObject:status];
}
self.listdata=statuses;
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: @"myCell"];
if (cell == nil) {
cell = [[ UITableViewCell alloc ] initWithFrame:CGRectZero];
}
NSUInteger row = [indexPath row];
cell.textLabel.text = [listdata objectAtIndex:row];
return cell;