This is documented at developer.apple.com.
If you wanna do it in iPhone apps, you would need to do a trick with the UIWebViewDelegate method shouldStartLoadWithRequest:
This api http://code.google.com/p/jsbridge-to-cocoa/ does it for you. It is very lightweight.
First make sure you have your webview as the setFrameLoadDelegate:
You need to tell the webview to watch for a specific object as soon as it's loaded:
Then the business of the communication:
Full project proof of concept file: https://github.com/bytestudios/JS-function-and-ObjC-method-connector
©2020 All rights reserved.