Hi all,
In the regular cocoa WebView there is a method [webview windowScriptObject] which returns an object that lets you expose objective-c objects to javascript running inside the webview. However, that method does not seem to exist for UIWebView, and I have been able to find no information about it in the docs. It appears that there was a delegate method
in 1.1.2/3/4 from sample code I've found, but that does not work in 2.0. Does anybody have any clue how to get the windowScriptObject or of any other means of sending a message from javascript running in a webview to objective-c? In particular, I want to be able to do something in Obj-C when the user clicks a link or scrolls in the webview, both of which would be easily accomplishable in cocoa.
Any help would be greatly appreciated.
In the regular cocoa WebView there is a method [webview windowScriptObject] which returns an object that lets you expose objective-c objects to javascript running inside the webview. However, that method does not seem to exist for UIWebView, and I have been able to find no information about it in the docs. It appears that there was a delegate method
Code:
- (void)webView:(WebView *)sender windowScriptObjectAvailable:(id)windowScriptObject
Any help would be greatly appreciated.