ill trying to code some calculator option. Please help me to create function pow(a, b) in NSExpression. need some like this:
extension NSNumber {
func pow() -> NSNumber {
return pow(self.doubleValue, 2)
}
}
var functionString = "FUNCTION(3, 'pow')"
var functionExpression = NSExpression(format: functionString)
var functionValue = functionExpression.expressionValueWithObject(nil, context: nil)//9
Please help me, How can i set the second value instead of "2" and change this when i created a functionString?