简体   繁体   中英

Ios: Saving / update more than one records at the same time with core data

I have a similar question with This . Basically, is there a way to save / update multiple records from the table view at once with core data?

All you really need to do is record which rows are checked and then alter the corresponding managed object appropriately.

A check mark is an accessory view so you would put the code to record which rows are checked (or save right then) in tableView:accessoryButtonTappedForRowWithIndexPath:

If you are using NSFetchedResults controller, you can just save the index path object in an array and it will record which managed object in the controllers fetchedObjects that you need to save/update because its table row got checked.

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