• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Saving Issue with Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Saving Issue with Core Data
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: [Moderator] EOT Re: New Cocoa w/ CoreData book
  • Next by Date: Getting the info from the Apple documentation -- Re: New Cocoa w/ CoreData book
  • Previous by thread: [Moderator] EOT Re: Getting the info from the Apple documentation -- Re: New Cocoa w/ CoreData book
  • Next by thread: Re: Saving Issue with Core Data
  • Index(es):
    • Date
    • Thread