Около 1% моих пользователей не работают в моем приложении, и я не могу понять, почему или повторить проблему. Crashlytics просто говорит
Сбой: com.apple.main-thread EXC_BREAKPOINT 0x0000000102bf023c
специализированный SearchTableViewController.tableView (UITableView,
didSelectRowAt: IndexPath) -> ()
, и она выделяет строку, в которой даже нет кода: строка 196, которая просто закрывает "}" функции didSelectRowAt indexPath. Я играю с этим несколько недель.
Модели:
- Все iOS 11
- Почти все, кажется, имеют менее 150 МБ свободной оперативной памяти во время сбоя
Трассировка стека здесь: https://imgur.com/8K5jG1I
Код:
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if chosenFoodObject == nil{
// User Chose a Food
chosenFoodObject = latestHitArray[indexPath.row]
// Update food download index
updateDownloadScore(foodID: chosenFoodObject!["objectID"] as! String)
// Gives size options for selected food
var sizeArray: [String]
sizeArray = Array(chosenFoodObject!.keys)
listResults.removeAll()
if let highlightIndex = sizeArray.index(of: "_highlightResult") {
sizeArray.remove(at: highlightIndex)
}
if let nameIndex = sizeArray.index(of: "name") {
sizeArray.remove(at: nameIndex)
}
if let downloadIndex = sizeArray.index(of: "downloads") {
sizeArray.remove(at: downloadIndex)
}
if let photoIndex = sizeArray.index(of: "photoURL") {
sizeArray.remove(at: photoIndex)
}
if let idIndex = sizeArray.index(of: "objectID") {
sizeArray.remove(at: idIndex)
}
for word in sizeArray{
listResults.append(word)
}
tableView.setContentOffset(CGPoint.zero, animated: false)
self.tableView.reloadData()
}
else{
// User chose a size
chosenSize = listResults[indexPath.row]
showFoodAlertController()
}
} //CRASH HAPPENS HERE