I was trying to update my project from Xcode 13 to Xcode 14.
But I got a lot of errors. They are similar but I don't know how to fix them. Take a look in the image below:
It's the same error that appears in a lot of files.
I try to click on "Type declared here".
But it didn't appear the error inside the Swift file.
When I click on "self declared here", I see this
It shows no error on the file.
When I was clicking on the errors, they vanish sometimes, but for some unknown reason, they reappear after some time.
Anyone got any idea of how to fix this?
EDIT 1:
The problem is related to the "OcrProcessingViewController" class.
I comment this class and the code starts to work again. But I still din't find what was causing the problem.
If I restore the code, I can see only one error now.
This is the full code on my "OcrProcessingViewController" class file
https://swiftfiddle.com/kfmxwr6snrbknne3msmapvkx5m
I suspect it is related to the "protocol CodigoOcrDataDelegate: AnyObject", but I don't know how yet how this happens.
CodePudding user response:
I find out what was causing the problem.
It was the property
lazy var textDetectionRequest: VNRecognizeTextRequest = {
let request = VNRecognizeTextRequest(completionHandler: handleDetectedText)
request.recognitionLevel = .accurate
request.recognitionLanguages = ["en_GB"]
return request
}()
I just need to move it to start of the class(removing it from inside the function) and everything works perfectly now on Xcode 14