Developer Documentation Library > Mobile SDK > Disconnected mobile application reference > Expression Evaluator reference > Expression evaluation for Objective-C
 
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
http://stevenpsmith.wordpress.com/2011/01/20/executing-javascript-from-objective-c-in-an-ios-app
CallJS example from the Apple site
https://developer.apple.com/library/mac/samplecode/CallJS/Introduction/Intro.html#//apple_ref/doc/uid/DTS10004241
Apple iOS provides an Objective-C to JavaScript bridge that allows closer integration between the two.
See also
Expression Evaluator reference