In good ole C I can do this:
int array[5];
int *iptr = array;
I have an Obj-C class with an ivar:
开发者_如何学Go float *m_quad;
exposed via a synthesized @propery:
@property (nonatomic) float *quad;
Is there anyway to do this:
float f = myClass.quad[2];
Assuming of course I have malloc'd and set values for m_quad?
Thanks,
DougShould work of the bat. I have an ivar and property
float diffuseColor_[4];
@property (readonly, nonatomic) float* diffuseColor;
The property is not synthesized, but using a simple accessor I can write
- (float*) diffuseColor
{
return diffuseColor_;
}
object.diffuseColor[3] = 1;
精彩评论