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 14. Reference Counting > Receiving Objects

Receiving Objects

So far, reference counting may seem like just a fancy name for “remember to free what you have allocated.” Its real usefulness becomes apparent when you start passing objects around from one method to another.

An object received from another method is presumed to remain valid for the remainder of the receiving method. In the following example, NSDate’s date method returns an object that represents the current time and date:


  

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