Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 7, 2008, 05: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, 12: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, 02: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, 02: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, 02: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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Core Data Integration ahan.tm iPhone/iPad Programming 0 Oct 11, 2011 07:49 PM
core data binding not working Javajax Mac Programming 3 Jul 10, 2011 01:23 PM
Resolved: Struggling with Core Data: Part 2 RonC iPhone/iPad Programming 2 May 27, 2011 01:02 PM
Help Needed - Xcode 4 Options: Use Core Data Include Unit Tests Mitch1984 iPhone/iPad Programming 3 Feb 26, 2011 03:42 PM
Creating Core Data objects outside of Managed Object Context Joanna Carter Mac Programming 5 Jul 9, 2009 09:24 AM


All times are GMT -5. The time now is 06:22 AM.

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

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