@synthesize a=b; 与@synthesize c;的差异
@synthesize a=b; 与@synthesize c;的区别
@synthesize a=b;
@synthesize c;
- (void)loadView {
a=1; //打印结果
b=9;
NSLog(@"loadView......%d",a); //结果 1
NSLog(@"loadView1......%d",b); 9
NSLog(@"loadView2........%d",[self a]); 9
NSLog(@"loadView......%d",a); 1
[self setC:5];
NSLog(@"loadView3......%d",c); 5
NSLog(@"loadView4........%d",[self c]); 5
}
个人觉得是引用。
@synthesize a=b;
@synthesize c;
- (void)loadView {
a=1; //打印结果
b=9;
NSLog(@"loadView......%d",a); //结果 1
NSLog(@"loadView1......%d",b); 9
NSLog(@"loadView2........%d",[self a]); 9
NSLog(@"loadView......%d",a); 1
[self setC:5];
NSLog(@"loadView3......%d",c); 5
NSLog(@"loadView4........%d",[self c]); 5
}
个人觉得是引用。