Inserting Data Into the Context | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/10794954-beginning-core-data/lessons/11

Hi! I am having a massive amount of issues after working with your core data videos. Every time I create a new project it automatically generates the old core data code from the previous lesson we had.

I need help ASAP!!!

If I start the Reminders-SwiftUI.xcodeproj Project in 11-inserting-data-into-the-context/Starter directory I get errors having to do with Signing & Capabilities. I could not figure out a way to resolve the conflicts between raywenderlich.com and my personal team (myself). Therefore I started a new Xcode 12.2 iOS App on Big Sur 11.0.1. I got everything in Chapter 10 done and the App runs in the simulator as in your video – so I thought I could just go this more modern, simpler way. However in Chapter 11, I don’t know how to incorporate your managedObjectContext in the new smaller @main App. Also, I apologize but I have never programmed in Objective C, only lots of C and C++ code. Below is what I have in the replacement for the AppDelegate and SceneDelegate files which is the new way to do it. Have you worked out how to do what needs to be done?

import SwiftUI
import CoreData

@main
struct Reminders_RWApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
// MARK: - Core Data Stack -
lazy var persistentContainer: NSPersistentContainer = {
let container = NSPersistentContainer(name: “Reminders”)
container.loadPersistentStores { (storeDescription, error) in
if let error = error as NSError? {
fatalError(“Unresolved error (error), (error.userInfo)”)
}
}
return container
}()
}

scene delagate and app delagate files cant find them )) and bunch of errors