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 18. Copying Objects > Copying Objects in Setter and Getter Methods

Copying Objects in Setter and Getter Methods

Whenever you implement a setter or getter method, you should think about what you’re storing in the instance variables, what you’re retrieving, and whether you need to protect these values. For example, consider this when you set the name of one of your AddressCard objects using the setName: method:

[newCard setName: newName];


  

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