• 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
NSController and NSCalendarDate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSController and NSCalendarDate
      • From: Scott Anguish <email@hidden>
References: 
 >strange NSWindowController memory leak (From: Georg Tuparev <email@hidden>)
 >Re: strange NSWindowController memory leak (From: Georg Tuparev <email@hidden>)

  • Prev by Date: Re: returning NSRectArray
  • Next by Date: bindings, NSTableView and overriding drawRow
  • Previous by thread: Re: strange NSWindowController memory leak
  • Next by thread: Re: NSController and NSCalendarDate
  • Index(es):
    • Date
    • Thread