1.OC中一个类由.h文件和.m文件组成,.h文件负责声明接口,.m文件负责具体实现
2.在.h文件中@interface后面的格式为类名:基类名
3.成员变量需要写在大括号内,最好使用下划线开头,使用成员变量需要写存取方法,为了开发效率,目前推荐使用属性代替成员变量,属性会自动生成带下划线的成员变量以及存取方法,还可以通过readonly,readwrite等来控制属性特性
4.成员方法以减号开头,静态成员方法以加号开头,参数类型以及返回值类型需要用括号括起来
5.可以通过重写description方法,让%@能描述自身
6.OC中self代表自己,super代表调用父类方法
7.在.m文件中可以使用@interface声明一些对外不可见的成员变量和成员方法
8.OC中可以通过@public @private @protecte等修饰成员变量,但是不能修饰成员方法