Re: Date + Formatter + Text Field Strangeness
Re: Date + Formatter + Text Field Strangeness
- Subject: Re: Date + Formatter + Text Field Strangeness
- From: Jonathon Mah <email@hidden>
- Date: Mon, 4 Dec 2006 07:09:28 +1030
On 2006-12-03, at 08:35, I. Savant wrote:
I have an application that keeps track of things based on a
reference date. For various reasons (one of which has to do with
the selected time scale - years, months, days, or time; another is
that the NSDatePicker control doesn't work right in 10.4 for my
purposes), the editor represents the date with several text fields,
one for each component.
Perhaps it would work better if you made some kind of wrapper class,
like ISMutableCalendarDate. Then bind the fields to
obj.mutableDate.month, and everyone should be happy.
I'm thinking of something like this. I'm not sure if it's worth the
effort to make it a subclass of NSCalendarDate, but obviously that
would be nice.
@interface ISMutableCalendarDate
{ NSCalendarDate *_realDate; }
- (int)month;
- (void)setMonth:(int)m;
@end
@implmementation ISMutableCalendarDate
- (int)month { return [_realDate month]; }
- (void)setMonth:(int)m
{
[_realDate release];
_realDate = [[NSCalendarDate alloc] initWithYear:[self year]
month:m day:...];
}
@end
Jonathon Mah
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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