• 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
Re: Core Data "Save as" versions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data "Save as" versions


  • Subject: Re: Core Data "Save as" versions
  • From: Adam Swift <email@hidden>
  • Date: Thu, 11 Sep 2008 16:57:02 -0700


On Sep 11, 2008, at 2:09 AM, Ken Tabb wrote:

Morning folks,

I was reading the Core Data version migration documentation, and it seems easy to use (haven't put it into practice yet as I was reading it on a sunbed on hols, and I have enough trouble sneaking programming books into the shared luggage, let alone the laptop etc.).

The docs are understandably written from a "how do I upgrade user's software version without wrecking their existing data" perspective, but I was wondering if:

[1] The same model migrations can be used to save documents as a previous version format (eg. save a file from v2.app as v1.xml format instead of v2.xml format, so they can send stuff to their mates who use the older version). Obviously assuming they don't mind losing the "new features" that won't be in v1.xml.

Absolutely. The store migration support facilitates transforming store data from one model version to another, it has no concept of new/ old.

[2] on a related note, if it's possible to generally save documents as sqlite (for compression purposes / atomic saving benefits etc.) but offer a "save as XML" type feature, so that your file format can be used by other apps. Or am I going about this the wrong way / might the XML file format change internally between Core Data revs, thus breaking any file reading ability other apps might have for my app's files?

Or for [2] would I be "better off" rolling my own text-based file format ([self twitch]) so that Core Data's internal SQL / XML formats can change without affecting my documents' readability in other apps?

The XML data format is human readable, but CoreData "owns" the format and I wouldn't recommend letting a non-coredata client edit that file. Along with the migration work that was introduced in Leoaprd, we also added support for writing your own custom store type where you control the on-disk data format - this is exactly the kind of thing you'd want to use it for.
Documented here http://developer.apple.com/documentation/Cocoa/Conceptual/AtomicStore_Concepts/Introduction/Introduction.html
example here http://developer.apple.com/samplecode/HTMLStore/index.html


Put another way, how do you go about having a Core Data doc-based app that can't be accused of having a proprietary (i.e. unreadable) file format as its native file format? That's not a criticism, just an innocent question!

I have tried to read all the Core Data docs I could find, so apologies if I've missed the obvious.

Thanks in advance for any light you can shed,
Ken

- - - - - - - - - -
Dr. Ken Tabb
Mac & UNIX Developer - Health & Human Sciences
Machine Vision & Neural Network researcher - School of Computer Science
University of Hertfordshire, UK



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Core Data "Save as" versions (From: Ken Tabb <email@hidden>)

  • Prev by Date: Re: Trying to compile an ObjectiveC and C++ program in XCode 3.1
  • Next by Date: Re: Core Data Migration Progress
  • Previous by thread: Core Data "Save as" versions
  • Next by thread: Inter-machine notifications
  • Index(es):
    • Date
    • Thread