Are there any transient caching attributes for kernel data?

I have the following script:

  • with the transient attribute used for partitioning
  • The web data model is updated periodically.
  • NSFetchedResultsController

Everything works fine, but when I do the update, this transition attribute seems to be deprecated.

The attribute is returned by the receiver in my object object. I tried to set a breakpoint in the accessory and notice that it is not actually called when my application starts and my NSFetchedResultsController. This seems to indicate that Core Data is caching this value somewhere (since my table is still located correctly). Is there any way to clear this cache?

+4
source share
1 answer

Yes. Use

+ (void)deleteCacheWithName:(NSString *)name; 

The name is the name that you specified during the NSFetchedResultsController initialization time, when called

 - (id) initWithFetchRequest:(NSFetchRequest *)fetchRequest managedObjectContext:(NSManagedObjectContext *)context sectionNameKeyPath:(NSString *)sectionNameKeyPath cacheName:(NSString *)name; 

setting the cacheName argument.

Alternatively, you can avoid caching Core Data during NSFetchedResultsController initialization: just pass nil for the cacheName argument.

+8
source

Source: https://habr.com/ru/post/1300187/


All Articles