What\'s the easiest way to create an array of structs in Cocoa?
It is easier to use class, but what if you need to work with C and objective c structs like CGRect or others. I've tried to use NSValue,but it work strange...:
CGRect rect =CGRectMake(20,220,280,30);
NSValue* rectValue = [NSValue valueWithCGRect:rect];
NSArray *params1;
params1= [NSArray arrayWithObjects:rectValue,nil];
But,I can get CGRect value only as:
CGRect cgr = [[params1 objectAtIndex:0] CGRectValue];
When I use this:
id currentVal = [params1 objectAtIndex:0];
void* buffer;
buffer=[currentVal pointerValue];
it causes the error...
problem solved here