I am adding some data in CloudKit with my record type called Post made in my .xcdatamodeld but all of my entry field names are adding the "CD_"
below is the logic im using :
add the environmentObject at the top of the view
@Environment(\.managedObjectContext) var managedObjectContext
saving to cloudkit using manageobjectcontext
var post = Post(context: self.managedObjectContext) post.title = self.viewModel.addPostTitle post.comment = self.viewModel.aboutPostComment post.serialNumber = 23 do { try self.managedObjectContext.save() } catch { print(error) }
my records should be returning example: "comment" but is instead returning "CD_comment"
below is the logic im using :
add the environmentObject at the top of the view
@Environment(\.managedObjectContext) var managedObjectContext
saving to cloudkit using manageobjectcontext
var post = Post(context: self.managedObjectContext) post.title = self.viewModel.addPostTitle post.comment = self.viewModel.aboutPostComment post.serialNumber = 23 do { try self.managedObjectContext.save() } catch { print(error) }
my records should be returning example: "comment" but is instead returning "CD_comment"
This happens automatically when you use NSPersistentCloudKitContainer. See https://developer.apple.com/videos/play/wwdc2019/202/?time=1291 at time 21:30.