0
NSCalendar 인스턴스에 calendarIdentifier 메시지를 보내려고합니다. 왜 내가 널 얻고(OBJ C) NSCalendar 인스턴스에 calendarIdentifier 메시지를 보내고 null을 수신합니다.
2015-01-08 19:12:26.651 TimeAfterTime[1325:40863] This NSDate Object lives at 0x10010fe70
2015-01-08 19:12:26.656 TimeAfterTime[1325:40863] The date now is 2015-01-09 00:12:26 +0000
2015-01-08 19:12:26.656 TimeAfterTime[1325:40863] Seconds since 1970: 1420762346.651615
2015-01-08 19:12:26.656 TimeAfterTime[1325:40863] The date after 100,000 seconds
from 2015-01-09 00:12:26 +0000 is : 2015-01-10 03:59:06 +0000
2015-01-08 19:12:26.656 TimeAfterTime[1325:40863] My calender is (null)
Program ended with exit code: 0
:
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
//Create a date instance.
NSDate *now = [NSDate date];
NSLog(@"This NSDate Object lives at %p", now);
NSLog(@"The date now is %@",now);
//Seconds from the date instance and 1970.
NSTimeInterval seconds_since_1970 = [now timeIntervalSince1970];
NSLog(@"Seconds since 1970: %f", seconds_since_1970);
//Future date from date instance.
NSDate *later = [now dateByAddingTimeInterval:100000];
NSLog(@"The date after 100,000 seconds from %@ is : %@", now, later);
//Create calender instance with user settings.
NSCalendar *cal = [[NSCalendar alloc] init];
NSString *calenderIdentity = [cal calendarIdentifier];
NSLog(@"My calender is %@", calenderIdentity);
return 0;
}
그러나, 어떤 이유로 나는 콘솔에서 반환으로이 얻을 : 이 내 코드? 나는 주변을 둘러 보았지만 아무 것도 찾을 수없는 것 같습니다.
덕분에,