我正在尝试从此URL www.overpass-api.de/api/xapi/xapi? [maxspeed = ] bbox = 5.6283473,50.5348043,5.6285261,50.53484]但是它将nil
返回到NSData
。我的代码是:
NSURL *url = [NSURL URLWithString:@"www.overpass-api.de/api/xapi?*[maxspeed=*][bbox=5.6283473,50.5348043,5.6285261,50.534884]"];
NSError *error;
NSData *urlData = [NSData dataWithContentsOfURL:url options:NSDataReadingUncached error:&error];
if (error) {
NSLog(@"%@", [error localizedDescription]);
} else {
NSLog(@"Data has loaded successfully.");
}
错误说" "文件" XAPI"无法打开,因为没有这样的文件。&quort'
请帮助如何下载从URL返回的XML并解析?
使它起作用!刚刚将http://
添加到链接的开头,然后返回适当的数据。哇!