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?

+3


source to share


2 answers


Take a look at Dave DeLong's DDMathParser framework .



+4


source


You can use GCMathParser .



+2


source







All Articles