Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 796
yassine bengharsallah Avatar asked Oct 31 '19 22:10

yassine bengharsallah


2 Answers

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.

like image 144
Yogesh Patel Avatar answered Oct 03 '22 05:10

Yogesh Patel


If your entity is actually created, just close and re-open XCode. This works for me everytime. The other solutions, such as clean build, build etc, didn't work for me.

like image 24
LondonGuy Avatar answered Oct 03 '22 07:10

LondonGuy