• 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
modeling NSManagedObject with large binary data attribute
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: modeling NSManagedObject with large binary data attribute
      • From: Chris Hanson <email@hidden>
    • Re: modeling NSManagedObject with large binary data attribute
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Killing a daemon process
  • Next by Date: Re: Building a view transparent to dragging
  • Previous by thread: Re: Core Data and Address Book API: Signal 6 (SIGABRT)
  • Next by thread: Re: modeling NSManagedObject with large binary data attribute
  • Index(es):
    • Date
    • Thread