选择器“dateWithTimeIntervalSinceNow”

时间:2015-11-23 19:40:42

标签: ios objective-c ios7

我的控制器(NSDatePicker的子类)中定义了UIViewController个实例:

@property (nonatomic, weak) IBOutlet UIDatePicker *datePicker; 

我尝试将最短日期设置为比当前日期时间晚60秒:

-(void) viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    // No known class method for selector "dateWithTimeIntervalSinceNow"
    self.datePicker.minimumDate = [NSData dateWithTimeIntervalSinceNow:60];
}

但是我遇到了编译器错误:

No known class method for selector "dateWithTimeIntervalSinceNow"

我不明白为什么?

0 个答案:

没有答案