会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
unity_lan
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
2014年12月19日
内存管理
摘要: 一、谁调用(alloc、new、retain、copy),谁释放。1、allocvoid test(Student *stu){ Book *book = [[Book alloc] iniWithPrice:3.5]; stu.book = book; [book release];}...
阅读全文
posted @ 2014-12-19 11:59 unity_lan
阅读(119)
评论(0)
推荐(0)
2014年12月17日
property,synthesize
摘要: 1、默认访问跟property同名的成员变量。如: 有成员变量 int age ; int age1;@property int age;@sythesize age; 则代表的是成员变量age的getter和setter方法。2、使用property和synthesize时,可以省略该成员变量的声...
阅读全文
posted @ 2014-12-17 18:10 unity_lan
阅读(171)
评论(0)
推荐(0)
protected,private,public
摘要: 1、如果把方法写在.m文件中,没有在.h文件中声明,则该方法为私有方法。2、成员变量默认是protected.
阅读全文
posted @ 2014-12-17 16:29 unity_lan
阅读(399)
评论(0)
推荐(0)
self
摘要: 谁调用方法,self就指向谁。- (void)test { int age = self.age;}+ (void)test2 { [self alloc];}
阅读全文
posted @ 2014-12-17 16:27 unity_lan
阅读(104)
评论(0)
推荐(0)
上一页
1
2
3
4
公告