2011-02-05 59 views
0

我将iPhone应用程序提交给苹果有一天,他们说我在过程中使用了一个私有API“-descriptionWithCalendarFormat:timeZone:locale”,这意味着我需要寻找替代我目前的代码是:我需要一个替代“-descriptionWithCalendarFormat:timeZone:locale”

NSString *lastSyncDate = [store.lastSync descriptionWithCalendarFormat:@"%Y-%m-%d %H:%M:%S" timeZone:[NSTimeZone timeZoneForSecondsFromGMT:0] locale:nil]; 

什么是最好的代码替代线?

回答

1

根据您的喜好创建并配置NSDateFormatter,然后致电-[NSDateFormatter stringFromDate:]