For the following block of code:
NSString *formul=@"5 < 9";
NSExpression *e = [NSExpression expressionWithFormat:formul];
int result = [[e expressionValueWithObject:nil context:nil] intValue];
NSLog(@"formule:%d", result);
I got error:
due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse the format string "5 < 9 == 1"'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…