views:

408

answers:

2

Hi,

does a method such as "eval" in Javascript exist in Objective-C (iPhone SDK) ?

I use PhoneGap and I want to create a window which is specific for each of my project and I can't use the html file... so I want from JS call a method and give in argument OC code to ben interpreted ...

Any idea?

Thank you for your help

+4  A: 

Sorry, there is no "eval" method in Objective-C, and the iPhone license specifically prohibits interpreted code. You can specify a xib/nib file by name, however.

Barry Wark
Hi, Thank you :-)
DJYod
A: 

Try this

NSString *returnOfJavascriptExecution = [webView stringByEvaluatingJavaScriptFromString:@"[your javascript code]"];

CoiSA
No, I want to do the opposite, evaluate OC from JS
DJYod