Why can't NSDate be compared using < or>?

前端 未结 4 1189
無奈伤痛
無奈伤痛 2021-01-14 09:48
NSDate *date = [NSDate date];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc]init];
[dateFormat setDateFormat:@\"MM/dd/yyyy\"];
NSLog([@\"today is \" stringBy         


        
4条回答
  •  一个人的身影
    2021-01-14 10:01

    You cannot use < or > for comparing dates. You have to use the correct methods. Have a look at this post.

提交回复
热议问题