以下解析器正在返回空值。 任何人都可以幫助我...解析不成功
-(IBAction)search:(id)sender
{
NSString *webserviceURL = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/textsearch/json?query=Delhi&sensor=true&key=AIzaSyCGeIN7gCxU8baq3e5eL0DU3_JHeWyKzic"];
NSURL *finalURl = [NSURL URLWithString:webserviceURL];
NSData *data = [NSData dataWithContentsOfURL:finalURl];
NSString *data1 = [NSString stringWithUTF8String:[data bytes]];
NSLog(@"Result is :%@", data1);
NSError * error;
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers|NSJSONReadingAllowFragments error:& error];
NSLog(@"Result is :%@", json);
}
「錯誤」是什麼意思,「數據」是什麼意思。 – dreamlax
@dreamlax等待我正在更新整個功能.... –
Sahil,嘗試解釋你實際上試圖實現的上下文,通過發佈你的相關代碼完全按照命令得到回答。 – Hariprasad