key-value support for Objective-C "class" variables?
key-value support for Objective-C "class" variables?
- Subject: key-value support for Objective-C "class" variables?
- From: Michael Johnson <email@hidden>
- Date: Sat, 28 Jul 2007 08:20:11 -0700
So this may be a hopelessly naive question, but as I refactor a bunch
of code to be all KV*, I realize that I have a few really handy class
variables, say:
@implementation Foo
static CGFloat _widthTolerance_ = .5;
+ (CGFloat)widthTolerance {
return _widthTolerance_;
}
+ (void)setWidthTolerance:(CGFloat)v {
_widthTolerance_ = v;
}
and I would really like to wire these up in IB with bindings for, say,
a debugging panel inside my app. Even if I'm wrapping them up inside
of some sort of app controller as a reflected instance variable there,
I'm then realizing that I'm not sure how I could notify interested
parties in the fact that these values changed, short of sending out a
notification.
I'm assuming this topic has come up before, but googling hasn't
helped...
What's the conventional wisdom on this?
--> Michael B. Johnson, PhD
--> http://homepage.mac.com/drwave (personal)
--> http://xenia.media.mit.edu/~wave (alum)
--> MPG Lead
--> Pixar Animation Studios
_______________________________________________
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