2

I am getting error in core data x code8.3, Data base is added DB.

Error is.....

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An NSManagedObject of class 'NSManagedObject' must have a valid NSEntityDescription

App Name : GPSLocation

Database Name : GPSLocationDataBase (Data base created middle of the project)

Entity Name : GPSLocationEntity

Piyush
  • 1,534
  • 12
  • 32
Marking
  • 184
  • 1
  • 2
  • 16

1 Answers1

2

Are you created the NSPersistentContainer with the GPSLocationDataBase name? Like

let container = NSPersistentContainer(name: "GPSLocationDataBase")

? A persistentContainer with different name can cause this issue.

In Obj-C:

NSPersistentContainer *container = [[NSPersistentContainer alloc] initWithName: @"GPSLocationDataBase"];
Balazs Nemeth
  • 2,333
  • 19
  • 29