Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MacDonaldsd

macrumors 65816
Original poster
Sep 8, 2005
1,005
0
London , UK
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 ?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
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?
 

MacDonaldsd

macrumors 65816
Original poster
Sep 8, 2005
1,005
0
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.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
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.
 

MacDonaldsd

macrumors 65816
Original poster
Sep 8, 2005
1,005
0
London , UK
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.