Skip to content Skip to sidebar Skip to footer

Stringbyevaluatingjavascriptfromstring Does Nothing

I'm using goNative.io to run my webapp in a wrapper/native iOS app. I'm adding bit of extra objective-c that reads the contents of HTML5 local storage and persists the data in the

Solution 1:

Your method stringByEvaluatingJavaScriptFromString will work only after the app run its web view delegate method "webViewDidFinishLoad". Until and unless your self.webview value would remain nil.

Try using below method.

  • (void)webViewDidFinishLoad:(UIWebView*)theWebView {

[theWebView stringByEvaluatingJavaScriptFromString:@"console.log('webViewDidFinishLoad');"];

}

And also make sure your "self.webview" is not nil.

Post a Comment for "Stringbyevaluatingjavascriptfromstring Does Nothing"