• 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: Simple date format problem? iOS 5
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple date format problem? iOS 5


  • Subject: Re: Simple date format problem? iOS 5
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 09 Aug 2012 18:58:53 -0700

On Aug 9, 2012, at 18:26 , Dave DeLong <email@hidden> wrote:

> Since you want an unlocalized date, you should just use [NSString stringWithFormat:] to build the name yourself, after breaking the NSDate up into its NSDateComponents using the Gregorian calendar.

I'd vote for this solution, too.

Keep in mind that the string you're going to come up with has to be run through 'fileSystemRepresentation' (or some equivalent) before it actually gets used in the file system. There's a chance that the formatter-generated string might contain non-representable characters. Also, the iCloud documentation warns about file name character sets for files that might get moved through the cloud for syncing, etc. Finally, you do need to be careful of case sensitivity in the iOS file system.

For all those reasons, you might be better off creating a file name that provably contains only ASCII characters by design (or, better, only letters in one case, digits and maybe the underscore), based on NSDateComponents as Dave suggests.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: 
 >Simple date format problem? iOS 5 (From: Alex Kac <email@hidden>)
 >Re: Simple date format problem? iOS 5 (From: Dave DeLong <email@hidden>)

  • Prev by Date: Re: How to...
  • Next by Date: Re: containerURLForSecurityApplicationGroupIdentifier
  • Previous by thread: Re: Simple date format problem? iOS 5
  • Next by thread: containerURLForSecurityApplicationGroupIdentifier
  • Index(es):
    • Date
    • Thread