In Objective-C properties you can set alternative names for the 开发者_Python百科accessors.
@property(setter=nameWrite:,getter=nameRead,copy) NSString *name;
I am thinking real hard but I don't know any situation I would ever do that. It is not KVC standard and I see no advantage at all. What is the use of it?
Mostly, it is used for BOOL properties:
@property(getter=isHidden) BOOL hidden;
@property(readonly, getter=isFinishedLaunching) BOOL finishedLaunching;
But, yeah, beyond that, it isn't used often at all (nor should it be).
It's seen all the time when you have a BOOL.
Ex:
@property(nonatomic,getter=isUserInteractionEnabled) BOOL userInteractionEnabled;
精彩评论