• 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: NSDateFormatter problem using NSShortDateFormatString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDateFormatter problem using NSShortDateFormatString


  • Subject: Re: NSDateFormatter problem using NSShortDateFormatString
  • From: Will Cosgrove <email@hidden>
  • Date: Mon, 16 Sep 2002 21:22:35 -0500

Hi Robert,
Thanks for the reply.

(You can simply do it by sending [icValueField setFormatter:nil]). Also, I would recommend to create a new NSCalendarDate instance and fill the icValueField programatically, just to check your formatter.

Ok, it accepts the NSCalendarDate and formats it correctly. If I set the date format to day/month/year and set the date with NSCalendarDate it again works, but if I try to enter a date manually in the text field it won't accept it no matter what format it's in. Thoughts? It acts like a bug to me.

Cheers,
Will

NSString *format;
NSDateFormatter *formatter;


format = [[NSUserDefaults standardUserDefaults] stringForKey:NSShortDateFormatString];
formatter = [[NSDateFormatter alloc] initWithDateFormat:format allowNaturalLanguage:YES];
//attach to editfield
[icValueField setObjectValue:[NSCalendarDate date]];

[icValueField setFormatter:nil];
[icValueField setFormatter: formatter];
_______________________________________________
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.

References: 
 >Re: NSDateFormatter problem using NSShortDateFormatString (From: Robert Cerny <email@hidden>)

  • Prev by Date: Re: table column text won't right justify
  • Next by Date: Re: window order preferences
  • Previous by thread: Re: NSDateFormatter problem using NSShortDateFormatString
  • Next by thread: Getting paper margins before printing
  • Index(es):
    • Date
    • Thread