public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "Cell2", for: indexPath) as! Cell2 var user: User if shouldShowTheResult { user = self.filtered[indexPath.row] } else { user = MessageController.users[indexPath.row] print(user.name) } cell.nameLabel.text = user.name <<-- Здесь возвращает nil return cell } - So does UILabel or user still return nil? - VAndrJ
- I didn’t specify, UILabel returns nil - Waver
- so what's in that line nil? cell or label only? - Max Mikheyenko
- nameLabel = (UILabel!) nil is in the debug area - Waver
- and cell is not nil ?? - Max Mikheyenko
|