You can pack the structure using dataWithBytes method pf NSData :
struct aStruct {
/* Implementation */
};
//Struct variable
aStruct exampleStruct;
// pack the struct into an NSData Object
NSData *myData = [NSData dataWithBytes:&exampleStruct length:sizeof(exampleStruct)];
// get back the the struct from the object
[myData getBytes:&exampleStruct length:sizeof(exampleStruct)];