Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC

< 前ページ次ページ >

カテゴリ

カテゴリは、クラスとほとんど同じ方法で宣言します。クラスを宣言しているインターフェイスファイルをインポートする必要があります。

#import "ClassName.h"
 
@interface ClassName ( CategoryName ) < protocol list >
method declarations
@end

プロトコルリストとメソッドの宣言は省略可能です。プロトコルをリスト指定した場合は、それらが宣言されているヘッダファイルもインポートする必要があります。

クラス定義と同様に、カテゴリ定義を含んでいるファイルは、自身のインターフェイスをインポートします。

#import "CategoryName.h"
 
@implementation ClassName ( CategoryName )
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