Stucked on加載下面的本地路徑url UIWebview。在spinepath中找到url,然後我轉換爲url [SpinePathUrl]。無法在UIWebview中加載Url,#轉換爲%23
我的問題是,當我嘗試加載時,我得到零值。 爲了檢查的目的,我粘貼SpinepathUrl到瀏覽器,它顯示的網頁不found.Then,我改變SpinePathUrl 「arugoswami-4.xhtml%23toc_marker-4」到「arugoswami-4.xhtml#toc_marker-4」,其顯示結果。
是我的問題在網址中。爲什麼#轉換爲%23,當它從String轉換爲Url時。
spinepath = [NSString stringWithFormat:@"%@%@",documentsDirectory,Path];
spinepath = [spinepath stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
spinepath = [spinepath stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[/用戶/ blazedream /庫/應用程序支持/ iPhone模擬器/ 7.1 /應用/ E19D2CD0-E0DC-460E-8BC9-97A9C8010910 /文檔/ UnzippedEpub/OEBPS/arugoswami-4.xhtml#toc_marker -4]
NSURL *SpinePathUrl = [NSURL fileURLWithPath:spinepath];
[文件:///Users/blazedream/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/E19D2CD0-E0DC-460E-8BC9-97A9C8010910/Documents/UnzippedEpub/OEBPS/arugoswami-4.xhtml%23toc_marker-4]
NSURLRequest *request = [NSURLRequest requestWithURL:SpinePathUrl];
[webView loadRequest:request];
請清除您的問題 – gran33 2014-11-05 09:48:58
你因此未明白嗎?/ – Ramdy 2014-11-05 09:55:31
沒有隊友,u能請註明問題和問題? – gran33 2014-11-05 09:57:07