ios - How to clone a CoreData SQLite backed persistent store to "in memory"? -
i'd create clone of coredata structure (not data) in memory. allow me write unit tests fresh coredata stack, , not have deal data stored in actual sqlite database.
as side note i'm using magicalrecord, may or not help.
what have in mind unit tests follow:
- during
- (void)setup
open app coredata store (sqlite) - clone store memory
- close persistent sqlite store
- open in memory store created
- delete data in memory store
- run tests
any idea? or better solution?
thanks
magicalrecord contains function called [magicalrecord setupcoredatastackwithinmemorystore]
. create in-memory store based on data model. there no need copying or of stuff mentioned because type of store not persistent (you said delete anyway before use it). don't worry cloning sql version, set memory version , use it.
Comments
Post a Comment