I am trying to parse a json string requested from an api located at: http://www.physics.leidenuniv.nl/json/news.php
However, i am having trouble parsing this json. I get
//call this method
-(void)syncWebByGETMethod
{
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
NSString *urlString = [NSString stringWithFormat:@"http://www.yoursite.com"];
NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]];
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse * response, NSData * data, NSError * connectionError)
{
if (data)
{
id myJSON;
@try {
myJSON = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
}
@catch (NSException *exception) {
}
@finally {
}
jsonArray = (NSArray *)myJSON;
NSLog(@"mmm %@",jsonArray);
}
}];
}