When defining properties on iOS @property (assign, nonatomic, getter=isDidSelected) BOOL didSelected; What does getter=isDidSelected mean? After the Demo I downloaded was written like this, the attribute isDidSelected was no longer defined.
我想大声告诉你2017-05-16 13:21:04
To put it bluntly, it’s just to change the name of the get method
If you don’t write getter=isDidSelected, then the get method of Boolean value didSelected is didSelected. You can
- (BOOL) didSelected {
return didSelected;
}
Come and rewrite it. Use together
self. didSelected
Come and get it.
If you write getter=isDidSelected, then the get method of Boolean value didSelected is isDidSelected. You can
- (BOOL) isDidSelected {
return didSelected;
}
Come and rewrite it. Use together
self. isDidSelected
Come and get it.