javascript - JavaScriptCore object getting lost -
we have code in viewdidload
self.context = [self.webview valueforkeypath:@"documentview.webview.mainframe.javascriptcontext"]; self.context[@"mobile"] = [webviewjavascriptinterface class];
and our class methods webviewjavascriptinterface exposed our first web page.
when user navigates page, these methods no longer available. "mobile" object not present.
is because page changed? should placing code, or other code need set in place? want these methods/mobile object available in web frame of pages.
moved lines -(void)webviewdidfinishload:(uiwebview *)webview
javascript ios ios7 ios8
No comments:
Post a Comment