我发言如下:
NSDate *Today = [NSDate dateWithTimeIntervalSinceNow:0];
NSDate *cDate = [Lines objectAtIndex:(NSUInteger) 0];
NSLog(@"cDate: %@ Today: %@", cDate, Today);
NSCalendar *calendar = [NSCalendar currentCalendar];
NSInteger desiredComponents = (NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit);
NSDateComponents *secondComponents = [calendar components:desiredComponents fromDate:Today];
NSDateComponents *firstComponents = [calendar components:desiredComponents fromDate:cDate];
缩略语
The last statement (firstComponents) which is very similar to the previous statement(secondComponents) crashes with the following error: unrecognized selector sent to instance
感谢任何帮助。