UIWebView javascript to objective-c bridge?

Discussion in 'iOS Programming' started by necubi, Aug 10, 2008.

  1. necubi macrumors newbie

    Joined:
    Jun 29, 2007
    #1
    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.
     
  2. slycrel macrumors newbie

    Joined:
    Jul 11, 2008
    #2

Share This Page