You can refer my answer here. In that answer i have mentioned how can you set rect which defined in baseapi.h with tesseract. Same way you can try for this too.
Go to Tesseract.mm file and add this code there.
- (NSString *)getHOCRText {
char *boxtext = _tesseract->GetHOCRText(0);
return [NSString stringWithUTF8String:boxtext];
}
Go to Tesseract.h file and define method :
- (NSString *)getHOCRText;
Then you can use that method to get HOCRText.
[tesseract getHOCRText];