Re: What's the point of @properties?
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