我很生气,可能是一个愚蠢的问题.
我有3个字符串:年,月和日.我需要有一个基于currentLocale的正确格式的日期,所以如果currentLocale localeIdentifier是en_US我的dateFormat应该是:MMM/dd/yyyy
如果它是fr_FR,则dateFormat应为dd/MMM/yyyy
我不认为这样做的唯一方法是获取currentLocale localeIdentifier并从一堆if开始.
提前致谢.
马克斯
cocoa-touch nsdateformatter ios nslocale
cocoa-touch ×1
ios ×1
nsdateformatter ×1
nslocale ×1