Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 7, 2008, 06:59 AM   #1
MacDonaldsd
macrumors 65816
 
MacDonaldsd's Avatar
 
Join Date: Sep 2005
Location: London , UK
Save individual Core Data object

Hi,

As as far as I can see you can't save an individual NSManagedObject, you can just tell the NSManagedObjectContext to save all the changes.

Is there anyway round this ?
MacDonaldsd is offline   0 Reply With Quote
Old Mar 7, 2008, 01:39 PM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
I don't think so. Maybe you could use a different file format that doesn't require rewriting the entire file, like SQLite? Or are you already using that?
kainjow is offline   0 Reply With Quote
Old Mar 7, 2008, 03:05 PM   #3
MacDonaldsd
Thread Starter
macrumors 65816
 
MacDonaldsd's Avatar
 
Join Date: Sep 2005
Location: London , UK
Im using XML to save the data at the moment.

Basically the problem is, I have some RSS syncing in the application so when any new entries are added I want to save them automatically. But as this happens in the background, the user may be editing a file and I don't want that to save until the user decides they want to.
MacDonaldsd is offline   0 Reply With Quote
Old Mar 7, 2008, 03:37 PM   #4
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
Can't you delay the saving until they've done their editing?

With XML it'll always write everything every time, so you may want to choose a better format.
kainjow is offline   0 Reply With Quote
Old Mar 7, 2008, 03:41 PM   #5
MacDonaldsd
Thread Starter
macrumors 65816
 
MacDonaldsd's Avatar
 
Join Date: Sep 2005
Location: London , UK
Quote:
Originally Posted by kainjow View Post
Can't you delay the saving until they've done their editing?

With XML it'll always write everything every time, so you may want to choose a better format.
Yeah I think your right. Just its easier to see how everything is getting saved in XML.

Yeah I suppose that is an option, or do something fiddly with two ManagedObjectContexts and Merge them.
MacDonaldsd is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Core Data do you have to pull out an object before you can update it? whitedragon101 iPhone/iPad Programming 3 Feb 23, 2014 06:13 PM
Need help with a conversion from SQLite data to Class Object Anim Mac Programming 7 Jan 31, 2014 01:30 AM
Individual app data usage iOS 6 aimee.elizabeth iOS 6 2 Jul 10, 2013 10:40 PM
Individual app data usage gowanis iOS 6 0 Sep 20, 2012 09:25 AM
Will backing up to computer/iCloud save game save data? RolandNights iPhone 3 Sep 18, 2012 01:30 PM

Forum Jump

All times are GMT -5. The time now is 05:09 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC