I have a struct defined like follows as part of an object. I’m trying to encode this for use with NSCoder with the aim of saving as well as Undo/Redo functionality.
struct myCol { float rd; float grn; float blu; float alp; } toolColor;
So, there are methods to encode e.g. -encodeBool:, -encodeFloat:, -encodeObject: etc. But how do you do this for a struct?
I think you should consider you struct myCol as memory buffer and encode it by something like encodeBytes function. Buffer length = size of your struct