On Tue, 24 Jul 2012 14:04:12 -0700, Quincey Morris said:

>I believe the answer is that you're Doing It Wrong™. :)

I know. :)  I only do it in one place, and only because the attribute is a few 
hundred MB, which I don't want to be copying all the time.

(The official Core Data recommendations for dealing with large BLOBs have 
always been very hand-wavy, with little-to-no framework support for their 
recommendations.  In 10.7 we now at least have the 'store in external record' 
option, but still no support for packages in NSPersistentDocument.  Despite me 
storing this large BLOB directly, performance is reasonable enough.  Besides, 
the app has shipped, and, barring migration, I can't change my model anyway.)

>For mutable values, you should either transfer ownership of the value
>to Core Data, or implement custom accessor methods to always perform a
>copy.

Which I always do for things like strings of few hundred bytes...

>Another way of saying all this is that it may not be possible to
>(reliably) inform Core Data that an attribute has changed without
>changing the identity of the object that represents the value.

:(  And changing the identity means using a different object... hmmmm... I 
guess since my object is basically a fancy wrapper of NSMutableData, I could 
actually copy my object but not copy the composed NSData too...

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 s...@rogue-research.com
Rogue Research                        www.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to