• 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: Persistent Stores and Packages ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Persistent Stores and Packages ...


  • Subject: Re: Persistent Stores and Packages ...
  • From: mmalcolm crawford <email@hidden>
  • Date: Mon, 23 May 2005 10:41:09 -0700


On May 23, 2005, at 9:42 AM, SA Dev wrote:

- The first is how to get my XML store (which is saving and opening just fine right out of the box) to be saved to and read from a package. What do I fudge with? Subclass a context, a persistent store, or will NSPersistentDocument do everything I need it to if I only override the correct methods? I'm aware I have to check the "Package" checkbox in my document types (I have a document with my chosen extension and a unique UTI, XML store type). What reference material can help me with this? Has anyone tried this yet?


From <
http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/ObjC_classic/Classes/NSPersistentDocument.html#// apple_ref/occ/cl/NSPersistentDocument>

"You can customize the architecture of the persistence stack by overriding the methods managedObjectModel and configurePersistentStoreCoordinator:forURL:ofType:error:. You might wish to do this, for example, to specify a particular managed object model, or to distribute storage of different entities among different file stores within a file wrapper."



- The second problem may be answered by the first problem's solution. I need to know how my NSManagedObject subclasses can ask their document for the package path (so, say, a "StoredImage" object can write itself to the package's Stored Images subfolder on -willSave and load/cache it again when its imageData is asked for. Or is this not the best way to do it? Let me elaborate ...

Again start with configurePersistentStoreCoordinator:forURL:ofType:error: -- see also <http://developer.apple.com/documentation/Cocoa/Conceptual/ NSPersistentDocumentTutorial/index.html>

mmalc


_______________________________________________ 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: Persistent Stores and Packages ...
      • From: mmalcolm crawford <email@hidden>
    • Re: Persistent Stores and Packages ...
      • From: SA Dev <email@hidden>
References: 
 >Persistent Stores and Packages ... (From: SA Dev <email@hidden>)

  • Prev by Date: Re: core data and dictionary
  • Next by Date: Re: core data and dictionary
  • Previous by thread: Persistent Stores and Packages ...
  • Next by thread: Re: Persistent Stores and Packages ...
  • Index(es):
    • Date
    • Thread