@property 的基本认识
来源:互联网 发布:linux打开telnet服务 编辑:程序博客网 时间:2024/06/18 16:46
//// Person.h// OC语言学习#import <Foundation/Foundation.h>/* @property 是一个编译指令 可以用@property来代替getter和setter 同时系统会生成一个 _开头的成员变量。(@property帮我们生成的成员变量,是一个私有的成员变量,也就是说在.m文件中生成的,不是在.h文件中生成的) 如果重写了setter方法,那么@property就只会生成getter方法;同理如果重写了getter方法,那么@property就只会生成setter方法。 如果同时重写了setter和getter,那么@property就不会自动生成私有的成员变量。 */@interface Person : NSObject@property(nonatomic,assign) int age;@property(nonatomic,assign) float height;@property(nonatomic,assign) double weight;@end
0 0
- @property 的基本认识
- Objective - C基础: 第三天 - 4.@property和@syhthesize的基本认识
- CSS的基本认识
- 电子元件的基本认识
- 光的基本认识
- Linux的基本认识
- CGContext的基本认识
- CGContext的基本认识
- CGContext的基本认识
- opencv的基本认识
- CSS的基本认识
- CGContext的基本认识
- CGContext的基本认识
- mappedBy的基本认识
- CGContext的基本认识
- CGContext的基本认识
- CGContext的基本认识
- CGContext的基本认识
- NYOJ448寻找最大数(贪心)
- 解决Ubuntu14.04 LTS中Chrome死机的问题
- 第三章 保证数据完整性
- 文章标题
- 简单总结2015股市
- @property 的基本认识
- 安卓相对布局的基本属性
- 2015年度引进版技术书TOP10
- Sicily 1741. Jaunt around the Zhuhai Campus
- android之旅23 多媒体处理2: 画画板
- Ajax异步验证用户名是否已经存在
- Linux基本的命令与快捷建(在centos版本下)
- TableView Segues
- 【南理oj】6 - 喷水装置(一)(贪心)