0

I have a problem with my attempt to show data in JSON UITableViewDataSource The data from JSON are:

[
 "Jon",
 "Bill",
 "Kristan"
]

JSON itself has gone through the validator. The error I have is TableViews [2050: f803] Illegal start of token [h]

Here is my code

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.

1 Answer 1

2

You don't fetch the JSON data from the URL. Instead you try to parse the URL itself.

Sign up to request clarification or add additional context in comments.

1 Comment

Can an example? I fear not you do not understand.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.