简体   繁体   中英

iOS Core data - problem saving new value to existing objects

I'm trying to save new value for an existing core data object:

[object setValue:Value forKey:NotificationKey];
NSError *error;
[object.managedObjectContext save:&error];

It's not saving the new data. Without any warning but maybe there is a problem with the save method. The process is going on background and invoking local notification at the end. After trying to find what's wrong, I've tried to make the save method before invoking the notification and it didn't rise.

Anyone sees the problem?

Thank you!

If the save occurs on a background thread/operation, you must merge the foreground and background threads/operations before changes made in one are available to the other.

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