ARC怎样管理“(strong)NSMultableArray添加(weak)object”内存

没事多学点 2015-03-17 12:07:33
iOS中使用ARC管理内存

如果我定义一个数组,如下
@ interface MyClass : NSObject

@ property (strong) NSMultableArray *array;

@ end


在另一个类中实例化MyClass

MyClass *myClass = [[Myclass alloc] init];

id __weak mySelf = self;

[myClass.array addObject: mySelf];

会发生循环引用吗,内存会泄露吗?
...全文
180 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

1,268

社区成员

发帖
与我相关
我的任务
社区描述
软件工程/管理 管理版
社区管理员
  • 研发管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧