Let me explain my question it is bugging me from long time. Any help will be appreciated. Please help.
I am working on hybrid kind of app in iOS. I am using UIWebView for loading webpages from http://myserver.com (its example its not actual URL) I have hosted multiple webpages on this server.
I am using "JSContext" to communicate between javascript (webpages loaded from my server) in UIWebView and native iOS functions.
I have followed procedure given at UIWebView JavaScript losing reference to iOS JSContext namespace (object) the context was getting lost but I have added workaround provided in solution of this question.
Event then for some frame load inside UIWebView my iOS context is getting vanished.
After following following steps context gets vanished.
- I load page1 from myserver in
UIWebView. Almost all works well all functions OS native iOS are called from javascript. - Now when second page2 is loaded as result of interaction in page1, in same
UIWebViewjavascript context gets vanished.
There is one more magical thing. if I have directly load page2 in UIWebView instead of indirect loading (page1->page2). All works well all native methods are called from UIwebView as expected.
Please help. If you want more info please ask.