您的位置:首页 > 移动开发 > Objective-C

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

2012-05-21 13:31 477 查看
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结尾
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: