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;