Posts

Post not yet marked as solved
3 Replies
HiI try to use the "NSBatchInsertRequest". but the insertResult is nil, and my CoreData is emptyI use the viewContext of the "NSPersistentCloudKitContainer".let container = NSPersistentCloudKitContainer(name: "CoreDataPerformance") container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { fatalError("Unresolved error \(error), \(error.userInfo)") } }) try container.viewContext.setQueryGenerationFrom(.current) let moc = container.viewContext moc.automaticallyMergesChangesFromParent = true moc.perform { let insertRequest = NSBatchInsertRequest(entity: Client.entity(), objects: clients) let insertResult = try? moc.execute(insertRequest) as? NSBatchInsertRequest if let success = insertResult as? Bool { print("RESULT: \(success)") } }This is the error I receive in the console.2020-02-04 18:30:25.800705+0200 CoreDataPerformance[62836:778869] [error] warning: Multiple NSEntityDescriptions claim the NSManagedObject subclass 'CoreDataPerformance.Client' so +entity is unable to disambiguate.CoreData: warning: Multiple NSEntityDescriptions claim the NSManagedObject subclass 'CoreDataPerformance.Client' so +entity is unable to disambiguate.2020-02-04 18:30:25.800846+0200 CoreDataPerformance[62836:778869] [error] warning: 'Client' (0x600000c50bb0) from NSManagedObjectModel (0x600001877480) claims 'CoreDataPerformance.Client'.CoreData: warning: 'Client' (0x600000c50bb0) from NSManagedObjectModel (0x600001877480) claims 'CoreDataPerformance.Client'.2020-02-04 18:30:25.800940+0200 CoreDataPerformance[62836:778869] [error] warning: 'Client' (0x600000c589a0) from NSManagedObjectModel (0x600001861680) claims 'CoreDataPerformance.Client'.CoreData: warning: 'Client' (0x600000c589a0) from NSManagedObjectModel (0x600001861680) claims 'CoreDataPerformance.Client'.Any ideas ?Thanks