Perhaps there is an NSNotification
fire when changing the field of an NSString
instance. Use the message here to understand how to communicate between JavaScript and Objective-C.
Then this is just a matter of notification and string logic:
Steps for JavaScript to Objective-C:
- The web browsing button is pressed.
- JavaScript runs a method that returns a string.
- The local NSString is updated to indicate the button in the web view has been clicked (see above).
- NSNotification is triggered based on a line change.
- Objective-C closes the web view.
Not sure what you want to pass to the web view from Objective-C, but the above post should help.
Jacob barnard
source share