• 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
key-value support for Objective-C "class" variables?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: key-value support for Objective-C "class" variables?
      • From: Scott Stevenson <email@hidden>
    • Re: key-value support for Objective-C "class" variables?
      • From: Jim Correia <email@hidden>
    • Re: key-value support for Objective-C "class" variables?
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: How can I add persistent data to a Cocoa CoreData file?
  • Next by Date: Using -interpretKeyEvents in NSTextView to interpret key events
  • Previous by thread: Re: How can I add persistent data to a Cocoa CoreData file?
  • Next by thread: Re: key-value support for Objective-C "class" variables?
  • Index(es):
    • Date
    • Thread