0
다음 주 마지막 날에 가고 싶습니다. 여기에 사용하고 있습니다 코드가 ...이다다음 주 마지막 날은
NSCalendar *gregorian11 = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *components1 = [gregorian11 components:NSWeekdayCalendarUnit | NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit fromDate:today1];
[components1 setDay:([components1 day]-([components1 weekday]-1)+14)];
NSDate *lastdayOfNextWeek = [gregorian11 dateFromComponents:components1];
NSDateFormatter *dateFormat_first = [[NSDateFormatter alloc] init];
[dateFormat_first setDateFormat:@"dd/MM/yyyy :EEEE"];
NSString *dateString_first = [dateFormat_first stringFromDate:beginningOfWeek1];
NSLog(@"last_date: %@", dateString_first);
출력 : last_date: 30/09/2012 :Sunday
지금, 나는 이것이 올바른 방법을 알고 싶어하거나 사람들이 더 나은 솔루션을해야합니까?
는 http://stackoverflow.com/questions/2719235/how-to-find-last-day-of-current-week-in-iphone 참조 – Maulik