Expression evaluation for Objective-C
JavaScript can be run directly from Objective-C by using the
stringByEvaluatingJavaScriptFromString on a
UIWebView class. The technique is similar to
Expression evaluation for Android.
1 An opcodes JSON representation is built.
2 A JSON representation of the identifiers and their values is built.
3 A JavaScript statement is created with the Expression class and the evaluate() method.
4 UIWebView::stringByEvaluatingJavaScriptFromString() is called.
More information
See:
Executing JavaScript from Objective-C in an iOS App
CallJS example from the Apple site
Apple iOS provides an Objective-C to JavaScript bridge that allows closer integration between the two.
See also