|
|
Log In | Not a Member? |
Contact ADC |
| < 前ページ次ページ > |
メソッドの宣言においては、次の規則が使用されます。
引数はコロン(:)の後に宣言します。
- (void)setWidth:(int)newWidth height:(int)newHeight |
通常は、引数を説明するラベルをコロンの前に付けます。次の例は、有効ですが望ましくない形式といえます。
- (void)setWidthAndHeight:(int)newWidth :(int)newHeight |
ラベルもコロンも、メソッド名の一部であると見なされます。
メソッドのデフォルトの戻り値と引数の型は、関数の場合のintではなく、idです(ただし、型の指定を続けずに修飾子unsignedを使用した場合は、必ずunsigned intの意味になります)。
| < 前ページ次ページ > |
Last updated: 2007-10-31
|
Get information on Apple products.
Visit the Apple Store online or at retail locations. 1-800-MY-APPLE Copyright © 2007 Apple Inc. All rights reserved. | Terms of use | Privacy Notice |