Hello. How do you set @synthesize for an array like: float rgb[3]. Also, is the @property line: @property(nonatomic, assign) float rgb?? Thanks
+2
A:
I don't believe that you can define the array size in the interface if you wish you use it as a property. You would need to do something like: (pardon any syntactical mistakes, this is from memory)
@interface MyClass : NSObject {
float *rgb;
}
@propery (nonatomic, assign) float *rgb;
Then in your implementation:
@implementation MyClass
@synthesize rgb;
@end
Then you would have to initialize the pointer using some C functions, such as:
rgb = (float *)malloc(sizeof(float) * 3);
craig
2009-04-07 21:02:55