1
테이블 중 하나에 다음 코드가 있습니다. EXC_BAD_ACCESS (오류 : CoreData : 오류 : NSManagedObject 클래스의 지정 초기화를 호출하지 못했습니다)스위프트 2에서 3으로 마이그레이션 핵심 데이터 NSManagedObject 클래스
그것은하지 않았다
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "InventoryTableCell", for: indexPath as IndexPath) as! InventoryTableViewCell
let inventory : Inventory = fetchedResultsController.object(at: indexPath as IndexPath) as! Inventory
cell.inventoryItem = inventory
cell.drawCell() //uses passed inventoryItem to draw it's self accordingly.
return cell
}
내가 cell.inventoryItem = inventory
에 런타임 오류를 받고 있어요 그것은 스레드 1 말한다 신속한 2에서 이렇게하므로 오류가 무엇인지 확실하지 않습니다. 내 모델의 스크린 샷을 찍어 수업을 만들겠습니다.
이전에 작동 했으므로 오류 수정 방법을 모릅니다. 무엇이 바뀌 었습니까?
"InventoryTableViewCell"클래스에서 "inventoryItem"변수를 초기화했는지 여부를 알 수 없습니다. 이 작업을 시작한 경우 옵션 변수로 변경하십시오. 같은 문제가 발생할 수도 있습니다. –