使用此github页面https://github.com/robmathews/OCR-iOS-Example,我下载并安装了repo并按照说明进行操作。尝试在手机上启动.xcodeproj文件在Tesseract.mm中提供了一个例外:
- (id)initWithDataPath:(NSString *)dataPath language:(NSString *)language {
self = [super init];
if (self) {
_dataPath = dataPath;
_language = language;
_variables = [[NSMutableDictionary alloc] init];
[self copyDataToDocumentsDirectory];
_tesseract = new tesseract::TessBaseAPI();
BOOL success = [self initEngine];
if (!success) {
return NO;
}
}
return self;
}
在return NO
行,xcode说Cannot initialize return object of type 'Tesseract *' with an rvalue of type 'BOOL' (aka 'bool')
。
我做错了什么?