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

Summary

These are the key points of Objective-C’s reference counting memory management system:

  • An object’s retain count keeps track of the number of other objects that are using the object. The retain count is frequently expressed as the number of owners an object has.

  • Objects are created with a retain count of one.

  • Sending an object a retain message increases its retain count by one.

  • Sending an object a release message reduces its retain count by one.

  • An autorelease message has no immediate effect, but it arranges to send a release message to its receiver at some future time.

  • When an object’s retain count reaches zero, the object is deallocated.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial