Objective-C初步研究 - 实现文件(Implementation File)

1. 实现文件以.m为后缀名

 

 

 

#import “myClass.h”

导入头文件

 

@implementation myClass

告诉编译器实现哪个类

 

@synthesize myLabel;

为实例变量产生getters和setters方法

 

类方法实现

+(NSString)myClassMethod:(NSString)aString {
 // Implement the Class Method Here!
}

 

实例方法实现

-(NSString)myInstanceMethod:(NSString)aString  anotherParameter:(NSURL)aURL {
 // Implement the Instance Method Here!
}

 

最后必须以@end结尾

 

posted @ 2012-05-21 13:31  Master HaKu  阅读(544)  评论(0编辑  收藏  举报