Re: virtual ivars
Re: virtual ivars
- Subject: Re: virtual ivars
- From: Kyle Sluder <email@hidden>
- Date: Sat, 29 Aug 2009 14:38:19 -0700
On Aug 29, 2009, at 1:49 PM, Todd Heberlein <email@hidden>
wrote:
I've been playing with KVC and KVO with my own setters and getters
(along with Controllers) to create virtual ivars. That is, there
never is any storage created for the variable and its value is
calculated on the fly when the getter is called. This seems to have
some cool potential, but it raises the following question:
Could this break with future Xcode or OS X upgrades?
In other words, is this approach an officially supported way to code
by Apple, or do they have the freedom to break this in the future?
If you can't set a value, don't provide a setter. If a setter might
not set the value the user provides, disable disable KVO notification
for that key and do it yourself.
--Kyle Sluder
_______________________________________________
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