NSController and NSCalendarDate
NSController and NSCalendarDate
- Subject: NSController and NSCalendarDate
- From: Andrew Salamon <email@hidden>
- Date: Tue, 23 Nov 2004 15:13:37 -0800
I would like to hook a number of controls up to a single
NSCalendarDate: year, month, day, hour, minute, am/pm, date, time (much
like in iCal). Simply binding the text fields to the data results in
fields being reset to some default date when another field is modified
by the user. E.g. set the time and the date resets to some default
value and vice-versa.
Right now what I have is a set of alternate methods for getting and
setting the individual components of the date variable. That works, but
has to be repeated for each NSCalendarDate. This seemed to me to be a
great place to insert an NSController subclass. What I thought I would
do is add a bunch of additional bindings to the subclass. One for each
piece of the date. Then each field would be bound to one of the
alternate bindings rather than 'selection'.
Unfortunately, I have no idea how to go about doing that. Especially if
I want the bindings to show up in IB. And I haven't been able to find
any documentation on it.
There's a very simple sample project at
http://members.cox.net/salamon/Macintosh/index.html that shows the
problem.
So, has anyone done this, or have any suggestions?
Andrew
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden