gali8 / Tesseract-OCR-iOS

Tesseract OCR iOS is a Framework for iOS7+, compiled also for armv7s and arm64.
http://www.nexor.it
MIT License
4.22k stars 949 forks source link

Why is G8TesseractDelegate a NSObject? #198

Closed iori57 closed 9 years ago

iori57 commented 9 years ago

I wish to use progressImageRecognitionForTesseract callback but the requirement for the delegate to be a NSObject seems weird to me. Isn't it easier to remove this requirement?

I created a class that manages tesseract operations but the class itself is not UIViewController, so making it one just so that it can be used as a G8TesseractDelegate seems strange.

kevincon commented 9 years ago

@ws233, you originally created the delegate (https://github.com/gali8/Tesseract-OCR-iOS/commit/6623f0af832897a180a108e6976f7566a680de0b); what do you think?

ws233 commented 9 years ago

@iori57, can you show a code snippet, which illustrates your efforts? So far I do not understand why conforming to NSObject protocol makes difficulties for you.

iori57 commented 9 years ago

Actually it is not a problem now that I've made my manager class (that handles all tesseract operations) a NSObject and it works wonderfully. Just a bit weird that my manager class is a NSObject while it isn't using any of NSObject functions nor behaviours.

Cheers!

ws233 commented 9 years ago

@iori57, as I remember Apple suggests to inherit any class from one of the available root objects. Otherwise it becomes root object itself. Anyway, if it's not an issue any more, would you mind colsing the issue?

iori57 commented 9 years ago

Will close the issue now. Thanks!