У меня есть таблица интерфейса пользователя с асинхронно загруженными данными из URL.для
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return (self.notificationsResponse?.data?.count)!
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let notification = notificationsResponse?.data![indexPath.row]
let cell = tableView.dequeueReusableCell(withIdentifier: "cell") as! NotificationsViewCell
cell.setNotification(notification: notification!)
return cell
}
var notificationsResponse:NotificationsResponse?
Я получаю сообщение об ошибке типа
Тема 1: EXC_BAD_INSTRUCTION (код = EXC_I386_INVOP, субкод = 0x0)
В этой строке
return (self.notificationsResponse?.data?.count)!
И я не знаю, что с этим не так.Я сталкиваюсь с проблемой, может быть из-за плохого понимания на swift
Может кто-нибудь, пожалуйста, помогите мне?