Saving Issue with Core Data
Saving Issue with Core Data
- Subject: Saving Issue with Core Data
- From: Mathieu Tozer <email@hidden>
- Date: Thu, 20 Apr 2006 14:44:21 +1000
I've got an issue where I can add and delete objects in my small
application but when I quit and re-run the new objects haven't been
saved. They previously did, however, as the application is
essentially just a modified Core Data prototype with a single entity.
The only thing I have modified is to add a controller object for some
buttons which do a few computations, and then update the selected
object like this:
NSArray *selectedObjectsArray = [activityTableController
selectedObjects];
NSManagedObject *selectedActivity = [selectedObjectsArray
objectAtIndex:0];
previousTime = [selectedActivity valueForKey:@"timeSpent"];
NSNumber *totalTime;
totalTime = [NSNumber numberWithInt:[previousTime intValue] + seconds];
[selectedObjectsArray setValue:totalTime forKey:@"timeSpent"];
Could this code be affecting the managedObjectContext to save?
There is also an IBOutlet to the activityTableController to obtain
the currently selected items declared in the controller header:
IBOutlet NSArrayController *activityTableController;
Any ideas?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden