工作,下面的代碼:的UIApplication的OpenURL:不與相對URL
NSURL *newsUrl = [NSURL URLWithString:@"/Document/News/1593" relativeToURL:[NSURL URLWithString:@"http://exist.ru"]];
// Outputs "http://exist.ru/Document/News/1593"
NSLog(@"%@", [newsUrl absoluteString]);
// works
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[newsUrl absoluteString]]];
// doesn't work
//[[UIApplication sharedApplication] openURL:newsUrl];
它是蘋果的錯誤?
'absoluteString'不回什麼是 「中」 的'NSURL'。您可能試圖打開網址的相關部分。你的錯誤是什麼? – Dustin 2012-08-15 12:30:18
沒有錯誤。方法調用後沒有任何反應。 – HiveHicks 2012-08-15 19:00:26
你有沒有想過*爲什麼會發生這種情況?我遇到完全相同的行爲。這沒有意義。 – Nik 2013-05-01 00:11:12