-1

If I have a webbased app, wrapped in a UIWebView, can I execute Objective C code form within the HTML code?

I hope I don't get downvoted to oblivion for asking this but I am not able to find anything online.

0

3 Answers 3

2

Doesn't C code need to be compiled? I don't think it can be executed within the HTML

Sign up to request clarification or add additional context in comments.

Comments

1

Its impossible.

but if you trying to create HTML5 application its possible using webview; http://conecode.com/news/2011/05/ios-tutorial-creating-a-web-view-uiwebview/

in this case you need create your application with Javascript and HTML. I recoment you to download jquery mobile and bootstrap mobile too.

For a complex app use Phonegap: http://phonegap.com/

2 Comments

Thanks for the additional details. Side question. Is it possible to develop a platform independent web based app using phonegap?
@user2891327 the phonegap are used to access the mobile function / events. Use jquery mobile to create you implementations and views, The phonegap api is only to access the device functions.
0

I'm assuming you mean that you have an iOS app that contains a UIWebView, and you want your embedded javascript to call ObjC. If so, see: https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptual/SafariJSProgTopics/Tasks/ObjCFromJavaScript.html

There are libraries that build on top of Apple's code. I've used Jockey (https://github.com/tcoulter/jockeyjs) and it works pretty well.

More info here: iOS JavaScript bridge

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.