2011-02-05 48 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:]