OC学习那些事:self、自动释放、变量作用域
摘要:
1.变量的作用域变量必须定义的{}中@public:全局都可以方法@protected:只能在类的内部和子类中访问(默认)@private:只能在类的内部方法@interface Student : NSObject { @public int _age; int _no; @private int _name; float height; } self->height直接访问成员变量2.自动释放使用autorelease方法,不用调用[sturelease]方法手动释放Student *stu= [[[Studentalloc]initWi... 阅读全文
posted @ 2013-08-15 18:33 bbsno 阅读(266) 评论(0) 推荐(0)