“eval”用于Objective-C代码 [英] "eval" for Objective-C code
问题描述
像JavaScript,Ruby,PHP或Python一样,Objective-C中是否存在 eval
的方法?
Does a method like eval
exist in Objective-C as in Javascript, Ruby, PHP, or Python?
我使用PhoneGap,我想创建一个特定于我的每个项目的窗口,我不能使用HTML文件。所以我想从JavaScript调用一个方法,并且其中一个参数是Objective-C代码。
I use PhoneGap and I want to create a window which is specific for each of my projects, and I can't use an HTML file. So I want to call a method from JavaScript and, with one of the arguments being Objective-C code to be interpreted.
推荐答案
对不起,Objective-C中没有eval方法,iPhone许可证特别禁止解释代码。但是,您可以按名称指定xib / nib文件。
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.
这篇关于“eval”用于Objective-C代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!