【发布时间】:2014-11-19 16:45:56
【问题描述】:
当我在创建 NSManagedObject 后尝试访问一个空属性时,它给了我一个 EXC_BAD_ACCESS (code=1, address=0x0)
let m = NSEntityDescription.insertNewObjectForEntityForName(entityName, inManagedObjectContext: context) as MyManagedEntity
println(m.numberProperty) // this is OK
println(m.stringProperty) // this gives me the exception
println(m.dateProperty) // this gives me the exception
任何想法如何解决它?
编辑:
当我投射到MyManagedEntity 时,我的测试中也得到了EXC_BREAKPOINT(code=EXC_I386_BPT, subcode-0x0)
【问题讨论】:
-
你能显示你的实体的属性定义吗?
标签: ios core-data swift nsmanagedobject