@property和@synthesize用法

来源:互联网 发布:sql数据库设置 编辑:程序博客网 时间:2024/05/21 10:57

@property int count;

相当于在.h中定义(声明)了一个方法

- (int)count;  


@synthesize count ;

相当于在.m中实现了一个方法

-(int)count{

    return count;

}

注:xcode4.5以后 @synthesize可以省略

0 0
原创粉丝点击