Re: storing ivars in core data docs

2009-12-23 Thread Quincey Morris
On Dec 22, 2009, at 21:40, Rainer Standke wrote:

 is there a way to store regular ivars in docs of a core data doc-based 
 applictions?

What's a doc? Seriously, are you talking about a file, or a 
NSPersistentDocument subclass instance, or what?

If you're asking Is it possible to archive arbitrary values as raw binary data 
or perhaps using the NSKeyedArchiver mechanism in a persistent store alongside 
but not within the Core Data database? then the answer is no. You have to 
implement persistent storage for a value kept in a regular ivar as a property 
of some Core Data entity using the techniques described in the Core Data 
documentation.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: storing ivars in core data docs

2009-12-23 Thread Rob Keniger

On 23/12/2009, at 9:18 PM, Quincey Morris wrote:

 What's a doc? Seriously, are you talking about a file, or a 
 NSPersistentDocument subclass instance, or what?
 
 If you're asking Is it possible to archive arbitrary values as raw binary 
 data or perhaps using the NSKeyedArchiver mechanism in a persistent store 
 alongside but not within the Core Data database? then the answer is no. You 
 have to implement persistent storage for a value kept in a regular ivar as a 
 property of some Core Data entity using the techniques described in the Core 
 Data documentation.


That's not 100% true, you can store an NSFileWrapper that contains a Core Data 
store as well as other files, so you can store whatever data you like. See this 
sample code for an example:

http://developer.apple.com/mac/library/samplecode/PersistentDocumentFileWrappers/

It's not perfect but it certainly works.

For the OP, as Quincey pointed out, your question is not clear. What are you 
trying to do?

--
Rob Keniger



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: storing ivars in core data docs

2009-12-23 Thread Quincey Morris
On Dec 23, 2009, at 03:28, Rob Keniger wrote:

 On 23/12/2009, at 9:18 PM, Quincey Morris wrote:
 
 What's a doc? Seriously, are you talking about a file, or a 
 NSPersistentDocument subclass instance, or what?
 
 If you're asking Is it possible to archive arbitrary values as raw binary 
 data or perhaps using the NSKeyedArchiver mechanism in a persistent store 
 alongside but not within the Core Data database? then the answer is no. You 
 have to implement persistent storage for a value kept in a regular ivar as a 
 property of some Core Data entity using the techniques described in the Core 
 Data documentation.
 
 
 That's not 100% true, you can store an NSFileWrapper that contains a Core 
 Data store as well as other files, so you can store whatever data you like. 
 See this sample code for an example:
 
 http://developer.apple.com/mac/library/samplecode/PersistentDocumentFileWrappers/
 
 It's not perfect but it certainly works.

Well, FWIW it was 100% true because I deliberately specified in a persistent 
store. :)

A file wrapper (or, *shudder*, a resource fork) might be a solution for a 
determined person, but it would be far easier to embed the data in a Core Data 
property.

Assuming that this is what the OP is asking about to begin with.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: storing ivars in core data docs

2009-12-23 Thread Sean McBride
On 12/23/09 4:10 AM, Quincey Morris said:

A file wrapper (or, *shudder*, a resource fork) might be a solution for
a determined person, but it would be far easier to embed the data in a
Core Data property.

Yup.  But then you have the joy of persistent store migration. :(

Another option might be to use the metadata methods, like
metadataForPersistentStore:.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: storing ivars in core data docs

2009-12-23 Thread Rainer Standke

Yes, that was my question. Thanks for your help,

Rainer


On Dec 23, 2009, at 3:18 , Quincey Morris wrote:


On Dec 22, 2009, at 21:40, Rainer Standke wrote:

is there a way to store regular ivars in docs of a core data doc- 
based applictions?


What's a doc? Seriously, are you talking about a file, or a  
NSPersistentDocument subclass instance, or what?


If you're asking Is it possible to archive arbitrary values as raw  
binary data or perhaps using the NSKeyedArchiver mechanism in a  
persistent store alongside but not within the Core Data database?  
then the answer is no. You have to implement persistent storage for  
a value kept in a regular ivar as a property of some Core Data  
entity using the techniques described in the Core Data documentation.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/lists%40standke.com

This email sent to li...@standke.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


storing ivars in core data docs

2009-12-22 Thread Rainer Standke

Hello,

is there a way to store regular ivars in docs of a core data doc-based  
applictions?


Rainer
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com