How do I tie an NSStepper to an NSDateFormatter?
How do I tie an NSStepper to an NSDateFormatter?
- Subject: How do I tie an NSStepper to an NSDateFormatter?
- From: Chris Ross <email@hidden>
- Date: Tue, 29 Oct 2002 23:39:57 -0500 (EST)
Hi there. This may be a newbie question, but I've had a lot
of trouble figuring it out.
I have an NSStepper next to a small NSTextField. When I had
a NSNumberFormatter attached to that text field (all done in IB),
I was able to attach the stepper and textfield to one another's
takeFloatValueFrom: actions, and it all worked great.
But, now that I've removed the NSNumberFormatter and put an
NSDateFormatter in (with format %M:%S, because I only want
a "pretty" representation of a small number of seconds (less
than an hour, at least)), I have no idea how to get the NSTextField
and NSStepper to work together. Connecting them to takeObjectValueFrom:
seems not to work at all. The formatter does keep me from entering
invalidly formatted times, and I was able to construct another
NSDate with that format (using 00:00 as the value) to calculate
an NSTimeInterval. But, I can't get the stepper to do anything
useful. I would like it to increment/decrement by seconds, rolling
into a minute increment/decrement at the appropriate time.
Can anyone give me some pointers on how to do this? Thanks
much...
- Chris
--
Chris Ross
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.