Apple Developer Connection
Advanced Search
Member Login 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




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
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