@property
来源:互联网 发布:韩国漫画软件下载 编辑:程序博客网 时间:2024/06/07 06:31
//三大类参数
//1.线程相关的
//atomic:原子访问,多个线程之间不可同时访问,线程安全的,效率不高
//nonatomic:非原子访问,线程不安全,效率高(一般使用它)
//@property (修饰属性的参数1,修饰属性的参数2,修饰属性的参数3)变量类型 变量名;
//2.内存管理相关
//retain:修饰对象类型
//copy:也是对象类型
//assign:修饰基本数据类型,修饰对象类型时表示弱引用
//strong:修饰对象,强引用,相当于retain
//weak:修饰对象,弱引用,相当于assign
//3.生成访问器相关
//readwrite:默认值,同时生成setter和getter方法
//readonly:只生成getter方法
@property (nonatomic,strong,readwrite)NSString *name;
@property (nonatomic,assign,readwrite)NSInteger age;
@property (nonatomic,assign,readwrite,getter=isMale)BOOL gender;
-(instancetype)initWithName:(NSString *)name age:(NSInteger)age gender:(BOOL)gender;
0 0
- property
- property
- Property
- @property
- @property
- property
- @property(..,..)
- property
- @property
- property
- property
- @property
- property()
- @property
- property
- @property
- property
- @property
- 《站在两个世界边缘》-程浩
- 数组类型 普通参数
- php 常用函数
- php final关键字
- UVA 11090 Going in Cycle!!
- @property
- block 深入理解
- 暗文显示和键盘模式
- web前端开发工程师“想都不用想”的几个知识点
- VOS2009官方升级功能更新日志大全
- tcp文件发送和接收-server端/windows
- 《Java实战开发经典》第五章5.3
- Android URI简介
- kvm虚拟机静态和动态迁移