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

NSDateFormatter problem using NSShortDateFormatString


  • Subject: NSDateFormatter problem using NSShortDateFormatString
  • From: Will Cosgrove <email@hidden>
  • Date: Fri, 13 Sep 2002 14:32:08 -0500

Hi All,
I have, what would seem to be, a simple question. I would like to set up a date formatter that uses the correct short date format from the International Prefs settings so I don't *inflict* the US date format on UK users for example. I'm trying to use NSShortDateFormatString and pass that into my formatter like so:

NSString *format
NSDateFormatter *formatter;

format = [[NSUserDefaults standardUserDefaults] stringForKey:NSShortDateFormatString];
formatter = [[NSDateFormatter alloc] initWithDateFormat:format allowNaturalLanguage:NO];
//attach to editfield
[icValueField setFormatter: formatter];

However, this absolutely doesn't work. It never accepts any input as valid. Does anyone know how I can get this working, I'm at a loss. It seems the format string is malformed or something like that.

Thanks in advance,
Will C.
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSDateFormatter problem using NSShortDateFormatString
      • From: Robert Cerny <email@hidden>
  • Prev by Date: limit text input in NSTextView
  • Next by Date: Re: Copy/paste multiple table rows
  • Previous by thread: Open source
  • Next by thread: Re: NSDateFormatter problem using NSShortDateFormatString
  • Index(es):
    • Date
    • Thread