Re: Simple date format problem? iOS 5
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