简体   繁体   English

这会导致保留周期

[英]would this cause a retain cycle

xCode 5.1, iOS 7.1, ARC Would this cause a retain cycle on topics? xCode 5.1,iOS 7.1,ARC是否会导致主题的保留周期? I don't think so, as setting event=nil will deallocate the whole tree, so topics will also get deallocated, but I am not sure. 我不这么认为,因为设置event=nil会取消分配整个树,所以主题也将被释放,但是我不确定。

 event -> subEvent -> Topics
  |                     ^
  |_____________________|

Referring to your graphic: 参考您的图形:

Both 'arrows' go from event to topics. 两个“箭头”都从事件到主题。 It would be a cycle if the lines/arrows would describe a cycle. 如果线条/箭头描述了一个周期,那将是一个周期。 (If topics would retain the event.) (如果主题将保留该事件。)

The graphic doesn't show a cycle thus there cannot be a retain cycle in there - so no. 该图形未显示循环,因此其中没有保留循环-因此没有。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM