Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 3. Memory Management > Avoiding Retain Cycles - Pg. 63

Avoiding Retain Cycles 63 Avoiding Retain Cycles 19 20 21 22 - (void)setDelegate: (id)aDelegate { delegate = aDelegate; } From: ivar.m The problem with pure reference counting is that it doesn't detect cycles. If you have two objects that retain references to each other, then neither will ever be freed. In general, this is not a major problem. Objective-C data structures tend to be acyclic, but there are some common cases where