我将公式存储1 && !0 && (0 || 1)
在NSString
变量中。我需要将此字符串评估为单个布尔值。有谁知道用于处理此或第 3 方解决方案的内置 obj-c 对象?
提前致谢。
我将公式存储1 && !0 && (0 || 1)
在NSString
变量中。我需要将此字符串评估为单个布尔值。有谁知道用于处理此或第 3 方解决方案的内置 obj-c 对象?
提前致谢。
Short of parsing it yourself, you won't be able to evaluate an expression like that in Objective-C during runtime since it is not an interpreted language.
Here are just a few (of many) other resources that pretty much echo this:
This post may get you a step closer to what you are trying to achieve. In any scenario, you will have to parse it yourself.