• 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
Re: Date + Formatter + Text Field Strangeness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Date + Formatter + Text Field Strangeness (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: nscombobox and nextkeyview
  • Next by Date: Re: DiskArbitration & Finder
  • Previous by thread: Date + Formatter + Text Field Strangeness
  • Next by thread: Re: Date + Formatter + Text Field Strangeness
  • Index(es):
    • Date
    • Thread