“评估"对于 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.
这篇关于“评估"对于 Objective-C 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!