我遇到此错误“ exc_bad_instruction(code = exc_i386_invop子代码= 0x0)”

时间:2018-08-30 12:00:18

标签: ios swift xcode collectionview exc-bad-instruction

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
     let cell = Collection_View.dequeueReusableCell(withReuseIdentifier: "list", for: indexPath) as! List_CollectionViewCell
     cell.list_name.text = items[indexPath.row]
     **cell.created_date.text = c_date[indexPath.row]**
     return cell
}

为什么xcode在此行上生成此错误?

1 个答案:

答案 0 :(得分:0)

当展开力失败时会出现此错误。确保将情节提要中原型的类在Identity Inspector中设置为List_CollectionViewCell

class

,并且在“属性”检查器中其标识符为"list"

identifier