0
我有我想驗證的數組:{ 「2」, 「+」, 「3」, 「=」,」 5「}關於 'DDExpression' 無可見@interface聲明選擇 'evaluateWithSubstitutions:錯誤:' 錯誤
那麼我該怎麼做呢?我發現DDMathParser和理論上,我將能夠驗證我的表達如下:
NSString *expression = [array componentsJoinedByString:@""];
NSError *error = nil;
DDExpression *e = [DDExpression expressionFromString:expression error:&error];
if (error == nil) {
NSLog(@"parsed: %@", e);
NSNumber * result = [e evaluateWithSubstitutions:expression error:&error];
//error: No visible @interface for 'DDExpression' declares the selector 'evaluateWithSubstitutions:error:'
}
任何想法爲什麼?我必須提及這種方法是在我的單身人士,但當我把它移動到我的視圖控制器錯誤留下來。
您已經添加'DDExpression.m'你的目標是什麼?是否已經導入了'DDExpression.h'或者只是使用了一個前向類聲明('@ class')? – 2013-02-26 17:17:15
@MikeD:我用#import「DDMathParser.h」 – Vad 2013-02-26 17:20:56