Search code examples
swiftxcodecore-dataentityswift4

Xcode 11 doesn't recognize Core data Entity


I just declared an entity called "Users" array:

var UsersArray = [Users]()

I got this error:

use of unresolved identifiers "Users"

hint : I did import CoreData and created the entity


Solution

  • Please try this solutions !!

    Solution 1 :- Product->Build for testing solved this issue for me(it solves most unresolved identifier bugs for some strange reason)

    Solution 2 :- changing import Foundation to import UIKit. It seems like UIApplication isn't included in Foundation framework.

    Solution 3 :- Highlight the Data Model, go to Editor -> Create NSManagedObject Subclass...

    Solution 4 :- Create the NSManagedObject files and then delete them and everything is fixed.

    Hope this helps thank you.