2012-05-31 88 views
2

我從ZaphNSDateComponents

iPhone - Correct way for getting current date and time for a given place/timezone and compare it with another date/time in the same place

此事閱讀下面的答案是,我不明白下面的代碼。

NSDate *newDate; 
NSDateComponents *dateComponents = [[NSCalendar currentCalendar] components:~ NSTimeZoneCalendarUnit fromDate:[NSDate date]]; 
newDate = [[NSCalendar currentCalendar] dateFromComponents:dateComponents]; 
.... 

我想向我解釋在NSTimeZoneCalendarUnit之前使用〜的原因。

謝謝。

回答

0

蘋果要求他們按位分配。這是NOT的C運算符。比較this