- #import <Foundation/Foundation.h>
- @interface Person : NSObject
- {
- //声明全变量
- int _number;//编号 OC中用NSInteger声明整型变量
- NSString * _name;//姓名
- }
- //全局也可以用@protected声明
- //成员方法
- - (void)setNumber:(int)number;
- - (void)introduce;
- @end
来源: http://www.phpxs.com/code/1006482/