Swift 2, warning: could not load any Objective-C class information from the dyld shared cache

后端 未结 5 1538
青春惊慌失措
青春惊慌失措 2021-02-04 23:43

I have found a few questions regarding this issue, yet none of them were helping with my problem. I am trying to save an object to core data using this code (which worked perfec

5条回答
  •  青春惊慌失措
    2021-02-05 00:02

    let fetchRequest = NSFetchRequest(entityName: "Patient")
    
    do {
      let fetchedResults = try managedObjectContext!.executeFetchRequest(fetchRequest)
      print("\(fetchedResults)")
    } catch {
      print("error")
    }
    

    The above code worked for me. Maybe the issue maybe with how your core data is managed.

    1. Check if your managedObjectContext is actually getting created.
    2. Check the modelling of your core data

提交回复
热议问题