Created
December 1, 2014 16:58
-
-
Save benjaminsnorris/7f074328e1e13eda1dda to your computer and use it in GitHub Desktop.
Parse string as equation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ([[equation substringToIndex:1] isEqualToString:@"+"]) { | |
equation = [equation substringFromIndex:1]; | |
} | |
NSExpression *equationExpression = [NSExpression expressionWithFormat:equation]; | |
NSNumber *equationNumber = [equationExpression expressionValueWithObject:nil context:nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment