mirror of
https://github.com/wnagrodzki/CocoaProgrammingGuidelines.git
synced 2025-05-06 19:11:47 +02:00
Property's default values are documented conditionally.
This commit is contained in:
parent
511ad4980d
commit
5b4c7f9adf
2 changed files with 19 additions and 9 deletions
Binary file not shown.
|
@ -451,16 +451,26 @@ A delegation method passes the sender as the first parameter. It is a good pract
|
||||||
\end{codelisting}
|
\end{codelisting}
|
||||||
|
|
||||||
|
|
||||||
%\subsection{Lallal}
|
\subsection{Property's default values are documented conditionally}
|
||||||
%
|
|
||||||
%a
|
|
||||||
%
|
|
||||||
%\begin{codelisting}
|
|
||||||
%@property (nonatomic) CGGradientRef tileGradient; // default: a lovely blue
|
|
||||||
%@property (nonatomic) NSInteger selectionBorderWidth; // default: 5 pixels
|
|
||||||
%@property (nonatomic) CGGradientRef selectionGradient; // default: a subtle white to grey gradient
|
|
||||||
%\end{codelisting}
|
|
||||||
|
|
||||||
|
The alloc method clears out the memory allocated for an object’s properties, by setting it to zero. If a property value is not altered during the initialization, a note about its default value may be omitted.
|
||||||
|
|
||||||
|
\begin{codelisting}
|
||||||
|
/*
|
||||||
|
* A Boolean value that determines whether the view is hidden.
|
||||||
|
*/
|
||||||
|
@property(nonatomic, getter=isHidden) BOOL hidden // represented by zeroed memory
|
||||||
|
\end{codelisting}
|
||||||
|
|
||||||
|
On the contrary, if the default value is changed, a mention about it is included.
|
||||||
|
|
||||||
|
\begin{codelisting}
|
||||||
|
/*
|
||||||
|
* Defines the anchor point of the layer's bounds rectangle.
|
||||||
|
* The default value of this property is (0.5, 0.5).
|
||||||
|
*/
|
||||||
|
@property (nonatomic) CGPoint anchorPoint // not represented by zeroed memory
|
||||||
|
\end{codelisting}
|
||||||
|
|
||||||
\subsection{Init methods take only mandatory parameters}
|
\subsection{Init methods take only mandatory parameters}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue