• 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
Re: What's the point of @properties?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's the point of @properties?


  • Subject: Re: What's the point of @properties?
  • From: Markus Spoettl <email@hidden>
  • Date: Sun, 19 Sep 2010 16:11:06 -0400

On Sep 19, 2010, at 3:52 PM, Jim Thomason wrote:
> I'm refactoring and updating a lot of my older code, and one of the
> things I'm finally looking into is declaring things as properties.
>
> But...what's the point?
> [...]
> Is there something else I'm not seeing or some other utility to them
> that I don't yet understand?


One thing you get is automatic KVO change notifications. When you set a property through its setter, you don't have to use -willChangeValueForKey: and -didChangeValueForKey: in order to trigger -observeValueForKeyPath: messages for those objects observing the property (via -addObserver:).

Regards
Markus
--
__________________________________________
Markus Spoettl

_______________________________________________

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: What's the point of @properties?
      • From: Bill Bumgarner <email@hidden>
References: 
 >What's the point of @properties? (From: Jim Thomason <email@hidden>)

  • Prev by Date: Re: Linked List
  • Next by Date: Re: What's the point of @properties?
  • Previous by thread: What's the point of @properties?
  • Next by thread: Re: What's the point of @properties?
  • Index(es):
    • Date
    • Thread