Save NSInMemoryStore into a NSSQLLiteStore ?

Hello,


I built an app using CoreData, and the model and the logic are great, the only problem, is that I have serious performance issues, my CPU reaches easily 90%. I found a solution using a InMemoryTypeStore, but I need to save its content into my persistent SQLLite Store using NSOperationQueue. Is somebody has a solution ? I basically want to use the InMemoryStore, and sync it everytime in another thread to the sqllite Store.


Some help willl really be appreciated.


Thanks in advance


R.H

Accepted Answer

You're probably looking at one of two solutions:

1. Setting up an NSIncrementalStore subclass, where you just hand off all of the operations to the InMemoryTypeStore instance.

2. Trying to update the sqlite store from change notifications

I'm not sure which would be the bigger headache.


Of course, the best solution overall would be to figure out what the actual cause of the CPU bottleneck you're hitting is. The sqlite debugging tools are getting better.

Hi,


Thank you for your answer, I think I will go for the change notifications, then I need basically to get the data from the sql lite store everytime my app starts, I understood that I can merge one store with another, but honestly, I didn't succeed to see a real example of that. Maybe you could help me ?

Save NSInMemoryStore into a NSSQLLiteStore ?
 
 
Q