Does anyone know why I am getting the exception at this code block:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("ListCell", forIndexPath: indexPath) as ListTableViewCell
let item = fetchedResultController.objectAtIndexPath(indexPath) as List
cell.list_name?.text = item.list_name
return cell
}
Here is the custom class I am casting to:
import UIKit
import CoreData
class List: NSManagedObject {
@NSManaged var list_name: String
@NSManaged var items: NSSet
}
The exception happens at this line:
let item = fetchedResultController.objectAtIndexPath(indexPath) as List
Here is the exception:
`libswiftCore.dylib`swift_dynamicCastClassUnconditional:
0x10d630860: pushq %rbp
0x10d630861: movq %rsp, %rbp
0x10d630864: testq %rdi, %rdi
0x10d630867: je 0x10d63089e ; swift_dynamicCastClassUnconditional + 62
0x10d630869: movabsq $-0x7fffffffffffffff, %rax
0x10d630873: testq %rax, %rdi
0x10d630876: jne 0x10d63089e ; swift_dynamicCastClassUnconditional + 62
0x10d630878: leaq 0xb52e9(%rip), %rax
0x10d63087f: movq (%rax), %rax
0x10d630882: andq (%rdi), %rax
0x10d630885: nopw %cs:(%rax,%rax)
0x10d630890: cmpq %rsi, %rax
0x10d630893: je 0x10d6308ad ; swift_dynamicCastClassUnconditional + 77
0x10d630895: movq 0x8(%rax), %rax
0x10d630899: testq %rax, %rax
0x10d63089c: jne 0x10d630890 ; swift_dynamicCastClassUnconditional + 48
0x10d63089e: leaq 0x36b7d(%rip), %rax ; "Swift dynamic cast failed"
0x10d6308a5: movq %rax, 0xb4c0c(%rip) ; gCRAnnotations + 8
0x10d6308ac: int3
0x10d6308ad: movq %rdi, %rax
0x10d6308b0: popq %rbp
0x10d6308b1: retq
0x10d6308b2: nopw %cs:(%rax,%rax)`