2013年6月10日

Why should a self-implemented getter retain and autorelease the returned object

摘要: -(id)getMyInstance {return myInstanceVar ;}or-(id)getMyInstance{return[[myInstanceVar retain] autorelease];}What's the difference ? The second one allows the caller to get an instance variable of a container object, dispose of the container and continue to play with the instance variable until t 阅读全文

posted @ 2013-06-10 23:09 残月下章台 阅读(172) 评论(0) 推荐(0) 编辑

导航