In the following code:
_imageView.hasHorizontalScroller = YES;
_imageView.hasVerticalScroller = YES;
_imageView.autohidesScrollers = YES;
NSLog(@"scrollbar? H %p V %p hide %p",
&(_imageView.hasHorizontalScroller),
&(_imageView.hasVerticalScroller),
&(_imageView.autohidesScrollers));
I get an error message:
Controller.m:143: error: lvalue required as unary '&' operand
Controller.m:144: error: lvalue required as unary '&' operand
Controller.m:145: error: lvalue required as unary '&' operand
Note that I use these variables as lvalues immediately before the lines and ...
How can he complain that the value is not an lvalue value right after I assigned it without errors? is this related to the magic getters / setters that the target C creates?
I think I need to explain some context to explain why I am trying to get the address:
in the previous SO message, I showed the same code by typing% d and finding that the properties were still 0 after the assignments. So, I decided that I would try to get the addresses of the properties to see where they are stored, and maybe , I can understand why I do not successfully appoint them, and then it happened.
, , , , , , obj-c ( , SO - ,
BOOL b = [_imageView setHasVerticleScroller: YES]
,
BOOL b = _imageView.hasVerticalScroller = YES;
.