I have a readonly BOOL property. What is dominant naming pattern here?
Background: for plain old method declarations, the accepted pattern
- (BOOL)isEditable;
- (void)setEditable:(BOOL)flag;
In a @property world, that would typically be expressed as
@property(getter=isEditable) BOOL editable;
However, there are examples to the contrary. Such as in CalStore/CalCalendar.h
@property(readonly) BOOL isEditable;
(Is CalCalendar wrong here, or is that the also an acceptable naming pattern for read-only BOOL properties?)
I've got a controller which manages a view, which may or may not be resizable. The property is read only.
@property(readonly) BOOL viewIsResizable;
@property(readonly) BOOL isViewResizable;
@property(readonly, getter=isViewResizable) BOOL viewResizable;
Which pattern is most natural or Cocoa-like?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…