title: Getting nilError from CoreData
body: <p>Context in environment is not connected to a persistent store coordinator: &lt;NSManagedObjectContext: 0x600002aa5520&gt;</p>
  <p>This is the error message and my App crashes
  It crashes in try when Saving Data to Core Data
  My print statements work well:</p>
  <p>titleString: Qqq</p>
  <p>The title of the list: Optional(&quot;Qqq&quot;)</p>
  <p>Not sure what to check?</p>
  <pre><code>import SwiftUI
  
  struct AddNewList: View {
  
  @Environment(\.managedObjectContext) var managedObjectContext
  @Environment(\.presentationMode) var presentationMode
  @State private var titleString: String = &quot;&quot;
  @State private var isAlertPresented = false
  
      var body: some View {
          Form {
              TextField(&quot;Placeholder&quot;, text: $titleString)
              Button {
                  self.saveList()
                  isAlertPresented = true
              } label: {
                  Text(&quot;Save&quot;)
              }
              .alert(isPresented: $isAlertPresented) {
                  Alert(
                      title: Text(&quot;Empty Title!&quot;),
                      message: Text(&quot;Please set a title&quot;),
                      dismissButton: .default(Text(&quot;Got it!&quot;))
                  )
              }
          }
  
      }
      
      private func saveList() {
          let newList = ListNames(context: self.managedObjectContext)
          newList.title = titleString
          print(&quot;titleString: \(titleString)&quot;)
          print(&quot;The title of the list: \(String(describing: newList.title))&quot;)
          do {
              try self.managedObjectContext.save()
              //Always a good idea to dimiss after saving
              self.presentationMode.wrappedValue.dismiss()
          } catch {
              print(error)
              #if DEBUG
              fatalError()
              #endif
          }
      }
  }
  
  //This is the App
  
  import SwiftUI
  
  @main
  struct MasterListApp: App {
  
  let persistenceController = PersistenceController.shared
  
  var body: some Scene {
      WindowGroup {
          NavigationView {
              GridViewPage()
                  .environment(\.managedObjectContext, persistenceController.container.viewContext)
          } 
      }
  }
  }
  
  
  // This is the landing page
  struct ListFrontPage: View {
      @Environment(\.managedObjectContext) var managedObjectContext
      
      @FetchRequest(entity: ListNames.entity(), sortDescriptors: [NSSortDescriptor(keyPath: \ListNames.title, ascending: false)]) var listNames: FetchedResults&lt;ListNames&gt;
      
      var body: some View {
          
          VStack {
              List() {
                  Text(/*@START_MENU_TOKEN@*/&quot;Hello, World!&quot;/*@END_MENU_TOKEN@*/)
                  ForEach (listNames) { listName in
                      Text(&quot;test&quot;)
                  }
              }
  
              Spacer()
              ZStack {
                  NavigationLink(destination: AddNewList()) {
                       Image(systemName: &quot;plus.circle.fill&quot;).font(.system(size: 64))
                  }
              }
          }
      }
  }
  </code></pre>