AMM
AMM

Reputation: 2205

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!

Upvotes: 0

Views: 548

Answers (1)

TechZen
TechZen

Reputation: 64428

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.

Upvotes: 1

Related Questions