Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

necubi

macrumors newbie
Original poster
Jun 29, 2007
4
0
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
Code:
- (void)webView:(WebView *)sender windowScriptObjectAvailable:(id)windowScriptObject
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.