The writing of array data to nsmarrHeader and nsmarrData work fine.
When I write those “2D” NSMutableArrays to the structure I get: Program received signal: “EXC_BAD_ACCESS”.
struct typeFile structFile;
[structFile.nsmarrHeader addObjectsFromArray: nsmarrHeader];
[structFile.nsmarrData addObjectsFromArray: nsmarrData];
this gets the same error:
[structFile.nsmarrHeader addObject: nsmarrHeader];
[structFile.nsmarrData addObject: nsmarrData];
So I am not sure what is wrong with writing to the structure or what I should do differently then?
thanks
if you have objective-c objects as plain structure fields then they are not initialized by default and so in your code you’re trying to send message to uninitialized object and thus get
EXC_BAD_ACCESSerror.Before using your structure fields you should explicitly initialize them, but I think if that’s possible better use objective-c objects instead of plain structs – that will make things much easier for you (e.g. memory management)