Comparing an NSDate to [NSDate date]

元气小坏坏 提交于 2019-12-03 06:02:41

I don't know the answer to your problem, but how you could circumvent it.

Just use the minimumDate property of the UIDatePicker, that's even a much cleaner approach.

You can use

[datePicker.date timeIntervalSinceNow]

which returns an NSTimeInterval (just a typedef for a double, in units of seconds) which is positive for the future and negative for the past.

As the doc says, compare provides subsecond comparison, so you can use this to force their date to be a full day later (instead of just sometime in the future).

An NSDate object contains both a date AND a time, so there are MANY dates with the same day that can fall before or after another date with the same day.

The date class method returns a date object with the current date day AND time.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!