modeling NSManagedObject with large binary data attribute
modeling NSManagedObject with large binary data attribute
- Subject: modeling NSManagedObject with large binary data attribute
- From: Jesse Grosjean <email@hidden>
- Date: Mon, 24 Oct 2005 08:56:59 -0400
In my object model I have an entity with several attributes. Most of
the attribute are standard things like dates and short strings. But I
have one "Binary Data" typed attribute that may be relatively large
in size, and so I would like to treat this attribute specially and
only load it on demand, separate from the other attributes.
My question is what's the best way to do this?
I was under the impression that when an entity is fetched all of its
attributes are also loaded at the time of this fetch, only it's
relationships are left as faults and loaded on demand. For this
reason I had been modeling this binary data attribute as a separate
entity referenced by the original. This way I know that the binary
data won't be loaded until it's explicitly accessed.
But I've just tried the simpler path and am now using a standard
"Binary Data" attribute in my entity instead of a relationship to
manage this data. And it seems like this is method works too. For
instance if I attach a large NSData (~150 mb) it appears (when I
print the object in the console) that this data is loaded as soon as
my managed object is loaded. But my applications launch time and
memory usage suggest this isn't really true. I'm guessing that the
NSData is being smart and lazily loading the data as needed.
So is there any advantage to modeling this data as a separate
relationship, or is it fine to just model it as a "Binary Data"
attribute? Thanks for any suggestions.
Jesse
_______________________________________________
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