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