I have to store a custom class object to Coredata. The problem is my custom class contains structs,enum etc.I tried following method.
-(void)encodeWit
You can wrap the struct in a NSData, ie
To encode with archiver
[coder encodeObject:[NSData dataWithBytes:&my_struct length:sizeof(my_struct)]
forKey:@"my_struct"];
and to decode with archiver
NSData *data = [coder decodeObjectForKey:@"my_struct"];
[data getBytes:&my_struct length:sizeof(my_struct)];