NSFetchedResultsController with transformable attribute

134 views Asked by At

We have application that stores user data in core data and syncs it with cloud kit with parent-child context stack. We need to keep the user data protected so except for id and modified data all other info is in the form of dictionary which is converted to encrypted data and stored in core-data as transformable attribute. We currently have 3 form of objects in our application

  1. CKRecord :- Sync data to CloudKit
  2. NSManagedObject :- Store data to core-data
  3. NSObject :- For UI operation and interaction with user.

Usually NSManagedObject can be used for 3rd point too. But the managed object does not have the properties that we need for searching and sorting. For example say we need to search by name but NSManagedObject have it as NSData in transformable attribute so we have to convert the NSManagedObject to NSObject and use the in our application.

Needed help for following issues

  1. How can we track the changes in core-data after sync so that we can update the UI accordingly. Currently after the notification we removeallobjects and refetch :- which is bad performance wise.

Parent Context :- used for main UI Child Context : Background sync with NSOperationQueue.

  1. NSFetchedResultsController can be helpful in this but then how can i use it transformable property for sorting and searching.
0

There are 0 answers