Question

In a UIWebView, I provide a link to http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html. In the simulator, TOC doesn't load. A space for it appears then quickly hides. However, on the iPhone, TOC loads and doesn't hide. User has to click the hide TOC link. What is the simulator doing that the iPhone isn't? Is there a way to do that on the iPhone so TOC is hidden?

Was it helpful?

Solution

I don't know what the subtle difference is between the simulator and the device (something cookie related?), but I would suggest that your solution should be to wait until the page finishes loading and then inject the javascript to forcibly close the TOC, as with:

[webView stringByEvaluatingJavaScriptFromString:@"showHideTOC('hide');"];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top