Skip to main content

Abstract

Remember back in the mists at the dawn of time when we wrote accessor methods for our instance variables? We wrote a lot of boilerplate code, creating both a -setBlah method to set the object’s blah attribute (obviously) and a -blah method to retrieve it. If the attribute is an object, we needed to retain the new one and release the old one. Utilities are out there that will turn your class definition into method declarations and definitions that you can paste into your files. But still, writing accessor methods is a lot of mind-numbing work that can better be applied to doing the cool stuff that’s unique to your program.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Scott Knaster, Waqar Malik, Mark Dalrymple

About this chapter

Cite this chapter

Knaster, S., Malik, W., Dalrymple, M. (2012). Properties. In: Learn Objective-C on the Mac. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-4189-8_11

Download citation

Publish with us

Policies and ethics