How does one use mmapped data with objects?
e.g. A UIImage.
If I know the offset and the number of bytes, and I can retrieve it, how is this used with objects?
I am a little confused on how to pass the data to an object, how does the object only use the exact number of bytes?
I currently fetch mmapped data byte by byte and write it to a file, this creates an image, but I am not sure on how to do this with an object.
Obviously there is no need to alloc the object as the data is available, but how is it passed to and managed by the object internally?
Effectively, the only way to allocate a Cocoa object is with
+alloc. I don’t think you can realistically use mmapped memory to persist objects.However, you can use it to retrieve the image data for a UIImage.