I'm using CocoaHTTPServer, and I'm able to start the server. In my resources folder, I added a file called "index.html", and here is something that made me confused.
I can get the path of the index file by
[mainbundle pathForResource:@"index" ofType:@"html"]
but it gave me the path as
/Users/Library/Application%20Support/iPhone%20Simulator/7.0.3/Applications/. Is there any way to make the path become a web-url likehttp://127.0.0.1:56000/user/library/.../index.html"to load it on an UIWebView.- I want to get the file path like the format above because I want to catch when the UIWebView request to it and when will the app response.
Is there any way for me to achieve it?? Thanks in advance.
You can load a resource into a
UIWebViewlike thisFor catching the requests of a
UIWebViewplease checkUIWebViewDelegateprotocol here. You can play around with following method for examplewebView:shouldStartLoadWithRequest:navigationType: