I have created a core data project in xcode 8.2, After that I created an entity say "TestEntity" in .xcdatamodeld
I am creating entity object by using following code as per given in some tutorials for swift3. enter link description here
let appDele = (UIApplication.shared.delegate) as! AppDelegate
let cont = appDele.persistentContainer.viewContext
let ent = TestEntity(context:cont)
But I got an error "use of unresolved identifier 'TestEntity'."
how to resolve that error.
Product->Buld for testing solved this issue for me(it solves most unresolved identifier bugs for some strange reason)
I solved it by changing
import Foundation
to import UIKit
.
Because UIApplication
isn't included in Foundation
framework.
"use of unresolved identifier 'TestEntity'."Means that you are trying to use a class/struct that is declared nowhere. Possibly you need to generate the NSManagedObjects for your entities.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With