Just a guess: I make an attribute and make it\'s type \"binary\". But in the end, how would I use that? I guess there is an NSData behind the scenes? So that attribute actually
This question has been asked a number of times and the answer is a bit more complex.
When it comes to binary data you should determine how to store it based on the expected size of data you are going to be working with. The rule is:
In addition, when you are storing images, it is recommended to store them in a standard format such as JPG or PNG. By using the transformable property type you can actually have your subclass give the appearance of accessing the UIImage
class when the actual store is a PNG representation. I go into this in detail in the bog post on Cocoa Is My Girlfriend.
The reason behind storing > 1M binary data on disk is because of the cache. The NSPersistentStoreCoordinator
will keep a cache of data so that when your app asks for the "next" object it doesn't need to go back out to disk. This cache works really well. However it is small, very small on iOS. If you pull in a big piece of binary data you can easily blow out that entire cache and your entire app suffers greatly.