Issues with Core Data Fetch Request Caching on macOS 13.6
I'm experiencing unexpected behavior with Core Data's fetch requests on macOS 13.6, specifically regarding caching. I have a large dataset and I'm trying to optimize performance by using a `NSFetchRequest` with caching enabled. However, it seems that my fetched results are not being cached as expected. Here's a snippet of my code: ```swift let fetchRequest = NSFetchRequest<MyEntity>(entityName: "MyEntity") fetchRequest.fetchBatchSize = 20 fetchRequest.returnsObjectsAsFaults = false fetchRequest.affectedStores = [persistentStore] // Custom persistent store let cachedResults = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: context, sectionNameKeyPath: nil, cacheName: "MyEntityCache") do { try cachedResults.performFetch() } catch { print("Failed to fetch cached results: \(error)") } ``` I expect the results to be cached and reused during subsequent fetches, but I'm still seeing multiple fetch requests hitting the persistent store for the same data, which is affecting performance. I verified that the `NSFetchedResultsController` is set up correctly, and I also tried running the app on a clean simulator environment to rule out any persistent store issues. Additionally, I'm seeing a warning in the console: `CoreData: warning: Unable to perform request. Entity is not in the cache.` This leads me to believe there's an issue with how the cache is being configured or utilized. I've tried resetting the cache and even switching to an in-memory store for testing, but the problem persists. Can anyone provide insight into how to ensure that Core Data properly caches fetch results, or is there a known issue with `NSFetchedResultsController` caching in macOS 13.6?