//
// Created by apple on 15-4-21.
// Copyright (c) 2015年 itcast. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Dog.h"
int main(int argc, const char * argv[]) {
@autoreleasepool {
Dog *heipi = [Dog new];
heipi.tuiNum = 10;
NSLog(@"tuiNum = %d",heipi.tuiNum);
}
return 0;
}
#import <Foundation/Foundation.h>
@interface Dog : NSObject
{
int _tuiNum;
}
// 关键字 类型 方法名(变量名)
//@property int _tuiNum;
/*
-(void)set_tuiNum:(int) _tuiNum;
-(int)_tuiNum;
*/
@property int tuiNum;
@end
#import "Dog.h"
@implementation Dog
-(void)setTuiNum:(int)tuiNum{
_tuiNum = tuiNum;
}
-(int)tuiNum{
return _tuiNum;
}
@end
|
|