12、属性声明和实现的完整例子
声明:XYZPersion.h文件
1 @interface XYZPerson : NSObject 2 - (void)sayHello; 3 @end
实现:XYZPersion.m文件
1 #import "XYZPerson.h" 2 3 @implementation XYZPerson 4 //用implementation类的实现 5 -(void)sayHello{ 6 NSLog(@"Hello, World!");
//@表示是一个OC类型的字符串 7 } 8 @end
挺好吃
浙公网安备 33010602011771号