FetchRequest - NSArray element failed to match the Swift Array Element type - Swift 2.0

时光毁灭记忆、已成空白 提交于 2019-12-04 08:50:01

I had the same problem. The issue was due to not setting the class property for the entity in model file.

Solution

var voitures: [NSManagedObject]?  = [NSManagedObject]()


if (voitures!.count > 0) {

        let voiture: NSManagedObject = voitures![indexPath.row]

        print((voiture.valueForKey("nom") as? String))
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!