Last Update 2013/02/13
TOP - Objective-C - @implementation
クラスまたはカテゴリの実装部の開始を示します。
@implementation 名前1 : 名前2
名前1
実装するクラス名
名前2
継承するクラス名(省略可能)
(例)
※ Xcodeで生成される「***_Prefix.pch」などのファイルの内容は記載しません。
#import <Foundation/Foundation.h>
@interface MyTestClass : NSObject
- (void)testMethod;
@end
@implementation MyTestClass // 実装部の開始で使用
- (void)testMethod
{
NSLog(@"MyTestClass → testMethod");
}
@end
int main (void)
{
MyTestClass *c1 = [[MyTestClass alloc] init];
[c1 testMethod];
return 0;
}
実行結果
MyTestClass → testMethod