|
|
Log In | Not a Member? |
Contact ADC |
| < 前ページ次ページ > |
新しいクラスは、@interfaceディレクティブを使用して宣言します。そのクラスのスーパークラスのインターフェイスファイルをインポートする必要があります。
#import "ItsSuperclass.h" |
@interface ClassName :ItsSuperclass < protocol_list > |
{ |
instance variable declarations |
} |
method declarations |
@end |
コンパイラのディレクティブとクラス名以外は、すべて省略可能です。コロンとスーパークラス名を省略すると、そのクラスは新しいルートクラスとして宣言されます。プロトコルをリスト指定した場合は、それらが宣言されているヘッダファイルもインポートする必要があります。
クラス定義を含んでいるファイルは、自身のインターフェイスをインポートします。
#import "ClassName.h" |
@implementation ClassName |
method definitions |
@end |
| < 前ページ次ページ > |
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 |