I want to generate some HTML content and put this into a UIWebView. The HTML contains some buttons. Is it possible to define actions for these buttons? I want to call a method (e.g. firstButtonPressed) in my objective-c code when someone presses this button in the UIWebView.
Thanks you for helping me.
This link http://davinc.me/post/45670387932/call-ios-method-for-html-button-click help me to resolve the same problem.
For button
Then become delegate of
and then use
Take a look at the phonegap project: www.phonegap.com
It is designed to do this kind of thing and more. If anything you will be able to get an idea how to code this as the project is open source.
Just to follow up on this, it is possible, and not to difficult to connect HTML/javascript events to objective-c methods.
Damien Berrigaud came up with a good example of how to do that by using
file://
links