iphone - How can I call objective-c code from within an html file in a UIWebView? -
so know type of thing achieved in java using jsp files, wondering how can mix code , html inside ios view. reason need have (local) html content being loaded uiwebview, , if click on html button, need fire ibaction example, , stuff locally.
is possible in xcode? missing?
you can not have objective-c code mixed html file runs locally on uiwebview
. said, there workarounds may fit needs.
one i've used, have html link custom url, , detect on appropriate method in uiwebview
delegate class, follows:
- (bool)webview:(uiwebview *)webview shouldstartloadwithrequest:(nsurlrequest *)request navigationtype:(uiwebviewnavigationtype)navigationtype
in method, check url
schema created means of checking request
parameter, , decide selector code on objective-c code.
Comments
Post a Comment