Swift: Core Data on IOS7 device -> entityForName on second entity is nil

前端 未结 1 2014
伪装坚强ぢ
伪装坚强ぢ 2021-01-06 10:11


i\'ve tested swift on a little iPhone project using Xcode 6 beta 2. The project uses core data to access 2 entities (User/Contract) in a data model. Inside the IOS Simu

相关标签:
1条回答
  • 2021-01-06 11:14

    It seems to be a bug for now. As explained on this post: https://devforums.apple.com/message/996259#996259.

    The workaround for this bug is to use a NSString instead of passing a String as the entity name:

        let myEntity: NSString = "EntityName"
        var fetchRequest = NSFetchRequest(entityName: myEntity)
    
    0 讨论(0)
提交回复
热议问题