1
你如何为数组设置@synthesize:float rgb [3]。另外,是@property行:@property(nonatomic,assign)float rgb ??谢谢你如何为数组设置@synthesize?
你如何为数组设置@synthesize:float rgb [3]。另外,是@property行:@property(nonatomic,assign)float rgb ??谢谢你如何为数组设置@synthesize?
我不相信你可以在界面中定义数组的大小,如果你希望你使用它作为一个属性。你需要做的是这样的:(赦免任何语法错误,这是从内存中)
@interface MyClass : NSObject {
float *rgb;
}
@propery (nonatomic, assign) float *rgb;
然后在您的实现:
@implementation MyClass
@synthesize rgb;
@end
然后,你将不得不使用一些C函数初始化指针,如:
rgb = (float *)malloc(sizeof(float) * 3);