2
我嘗試以下線的iOS應用程序,並在基礎工具:stringByAppendingPathComponent中的基礎錯誤?
[@"http://www.apple.com/" stringByAppendingPathComponent:@"/"]
每次的結果我得到的是:
@"http:/www.apple.com"
換句話說,stringByAppendingPathComponent
,除了不追加任何東西(我預期的),吞下最後的/
(可以認爲是OK,排序),和嚥下一個URL模式/
,這完全是不是確定在我的書中。
這是隻發生在我身上嗎?在提交錯誤報告之前,我錯過了一些愚蠢的事情嗎?
arf,我沒有看到文檔中的註釋。好吧不是一個錯誤。我的錯。謝謝。 – 2011-04-06 15:27:09
這也失敗了:'[[NSURL URLWithString:@「http://www.apple.com」] URLByAppendingPathComponent:@「/」]'。它返回'http://www.apple.com ///'。 'URLWithString:relativeToURL:'似乎工作正常,但。 – 2011-04-06 15:43:07