Сбой EXC_BAD_ACCESS только на устройстве
Я получаю сбой при нажатии кнопки
let requester = VNRecognizeTextRequest { request, error in
guard let observations = request.results as? [VNRecognizedTextObservation] else {
fatalError("Received invalid observations")
}
for observation in observations {
guard let bestCandidate = observation.topCandidates(1).first else {
print("No candidate")
continue
}
if bestCandidate.string.contains(".") {
self.allTextString.append(" \(bestCandidate.string)")
}
print("Found this candidate: \(bestCandidate.string)")
}
if self.allTextString == "" {
self.showActionSheetTitleMessageOnMainThread("Temperature not found", message: "")
} else {
self.TempratureValue.text = self.allTextString
}
}
let requests = [requester]
При создании массива переменной запрашивающей. На симуляторе код работает нормально. И память для запрашивающей стороны выделяется, но при работе на устройстве запрашивающая память не инициализируется.