摘要: id相当于NSObject *但是略有不同,NSObject *是静态数据类型如Student继承Person继承NSObject,Person有age方法,Student有score方法Person *p=[Student new];[pscore];会编译出错,不能直接访问子类方法Student... 阅读全文
posted @ 2016-01-12 21:33 爱上咖啡的唐 阅读(228) 评论(0) 推荐(0) 编辑
摘要: @property 数据类型 属性名(去掉下划线);@property int age;如果此时加了下划线@property int _age;则相当于给双下划线属性赋值__age设置读写属性@property (readonly) int age;//只读(只有get没有set方法)@proper... 阅读全文
posted @ 2016-01-12 19:27 爱上咖啡的唐 阅读(267) 评论(0) 推荐(0) 编辑