On Aug 9, 2012, at 18:26 , Dave DeLong <davedel...@me.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to