• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[newbie] Use of accessors versus direct access of ivars
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[newbie] Use of accessors versus direct access of ivars


  • Subject: [newbie] Use of accessors versus direct access of ivars
  • From: Stuart Malin <email@hidden>
  • Date: Thu, 8 Jan 2009 19:27:36 -1000

I have a class with ivars for which there are accessors. I understand that the importance of using a setter method (or to use setValue:ForKey:) to set the ivar so that KVO operates. However, Is there a compelling reason to use, in the methods of a class, a getter method (or valueForKey:) versus directly accessing an ivar of the class?

I have re-read both the Key-Value Observing Programming Guide and Key- Value Coding Programming Guide, and have not derived guidance from them on this question. Perhaps I have missed something.
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: [newbie] Use of accessors versus direct access of ivars
      • From: Quincey Morris <email@hidden>
    • Re: [newbie] Use of accessors versus direct access of ivars
      • From: "Adam Foltzer" <email@hidden>
  • Prev by Date: Re: Visualization strategy/choosing a framework
  • Next by Date: Re: Getting to the Console Logs
  • Previous by thread: Re: Please help
  • Next by thread: Re: [newbie] Use of accessors versus direct access of ivars
  • Index(es):
    • Date
    • Thread