我想用everyday[0].psetremind
从CoreData获取一个属性来请求它是真还是假但是当我开始它时会出现这个错误
libc ++ abi.dylib:以NSException类型的未捕获异常终止 (lldb)
什么可能是问题? 谢谢你的帮助:)
viewdidLoad中的代码:
if everyday[0].psetremind == true {
print("\(everyday[0].psetremind)")
//PNotification()
}
ViewController中的代码:
var everyday = [Everyday] ()
var mgdContext = (UIApplication.sharedApplication().delegate as! AppDelegate).managedObjectContext
func loaddata () {
let fetchrequest = NSFetchRequest(entityName: "Everyday")
everyday = try! mgdContext.executeFetchRequest(fetchrequest) as! [Everyday]
}