我尝试在 JSON UITableViewDataSource 中显示数据时遇到问题来自 JSON 的数据是:
[
"Jon",
"Bill",
"Kristan"
]
JSON 本身已经通过了验证器。我遇到的错误是 TableViews [2050: f803] Illegal start of token [h]
这是我的代码
NSString *myRawJson = [NSString stringWithFormat:@"http://site.com/json.php"];
if ([myRawJson length] == 0){
return;
}
NSError *error = nil;
SBJsonParser *parser = [[SBJsonParser alloc] init];
tableData =[[parser objectWithString:myRawJson error:&error] copy];
NSLog(@"%@", [error localizedDescription]);
list = [[NSArray alloc] initWithObjects:@"Johan", @"Polo", @"Randi", @"Tomy", nil];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.