0
我想從此URL下載XML文件www.overpass-api.de/api/xapi?[maxspeed=][bbox=5.6283473,50.5348043,5.6285261,50.534884] 但它返回nil
到NSData
。我的代碼是:從URL下載XML文件返回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
請幫助我如何可以下載XML從返回’無法打開,因爲沒有這樣的文件。」網址並解析它?