1

I am trying to use Core Data. I created a new entity with attributes but my Fetch Request always says it can't find it. I'd really appreciate the help

ContetView:


struct ContentView: View {
   
    @FetchRequest(entity: Recipe.entity(), sortDescriptors: []) var recipes: FetchedResults<Recipe}


import SwiftUI

@main
struct Selfmade_KochbuchApp: App {
    let persistenceController = PersistenceController.shared

    var body: some Scene {
        WindowGroup {
            ContentView()
                .environment(\.managedObjectContext, persistenceController.container.viewContext)
               
        }
    }
}
nico_p2000
  • 23
  • 5

1 Answers1

0

I fixed it by restarting Xcode and my MacBook. It seems to be an Xcode issue, because the caching.

nico_p2000
  • 23
  • 5
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/late-answers/30797651) – Lawrence Gimenez Jan 14 '22 at 13:26