Evaluate math expression in string? (NSString)

Possible duplicate:
What is a fast C or Objective-C math analyzer?

I have an NSString which is a computation for example. @"(10+10)*2"

and I want to evaluate the string as if it were something like this:

double result = (10+10)*2;


What's the easiest approach for iOS?


source to share

2 answers

Take a look at Dave DeLong's DDMathParser framework .



You can use GCMathParser .



All Articles