Hi,
I have started storing some files that were previously in the resources folder
of the main bundle, in C arrays instead so they are embedded in the executable,
and no longer plainly visible in the file system (if one goes looking in a jailbroken device).
One reason is to make it harder for someone extracting data you didn't want
them to without encryption
(you'd have to at least know how to cut the file out of the executable with a hex editor),
and another is to load UIImages from C arrays (particularly bitmaps),
to perform operations on the C array and reload it to the UIImage object
(say you just wanted to invert the green component of the image
and invert it back at some stage).
My question is with regard to any consequence with RAM consumption.
If a UIImage is loaded from a C array, I think two instances of the same
image data will exist in RAM. If the UIImage is loaded from a file in the
main bundle, I don't know if the original png data (for example),
would be freed from RAM once it's able to be represented as a bitmap on the screen.
So I don't know if the usual way is more effective memory wise.
Any thoughts on that?
I have started storing some files that were previously in the resources folder
of the main bundle, in C arrays instead so they are embedded in the executable,
and no longer plainly visible in the file system (if one goes looking in a jailbroken device).
One reason is to make it harder for someone extracting data you didn't want
them to without encryption
(you'd have to at least know how to cut the file out of the executable with a hex editor),
and another is to load UIImages from C arrays (particularly bitmaps),
to perform operations on the C array and reload it to the UIImage object
(say you just wanted to invert the green component of the image
and invert it back at some stage).
My question is with regard to any consequence with RAM consumption.
If a UIImage is loaded from a C array, I think two instances of the same
image data will exist in RAM. If the UIImage is loaded from a file in the
main bundle, I don't know if the original png data (for example),
would be freed from RAM once it's able to be represented as a bitmap on the screen.
So I don't know if the usual way is more effective memory wise.
Any thoughts on that?