简体   繁体   中英

Is there any delegate method for network operation in CoreData mapping with RestKit 0.20

I want to delete existing managed objects from CoreData if network operation is success in CoreData mapping with RestKit. We have a completion block in CoreData mapping with RestKit but we will reach there only after saving the objects in context.

RestKit can perform a delete for you as part of the mapping process, you just need to provide the fetch request to tell it how to find the items that you want to be deleted. Check the documentation here , in the section "Fetch Request Blocks and Deleting Orphaned Objects".

Using this technique does require that you're using RKObjectManager . If you aren't you can still run a fetch request and do the purge yourself but you'll need to deal with not deleting the new items yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM