ios struct property

来源:互联网 发布:java中调用webservice 编辑:程序博客网 时间:2024/06/16 17:25
ios 中property应该怎样修饰struct?
typedef struct s {    int i;} s;@interface Test : NSObject {    s *myS;}@property (nonatomic, assign) s *myS;@end@implementation Test@synthesize myS;- (id) init {    self = [super init];    myS = malloc(sizeof(s));    myS->i = 0;    return self;}@end// somewhere later.Test *t = [[Test alloc] init];t.myS->i = 10;
0 0