Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用比较方法比较两个日期。当我使用日期格式化程序作为稳重的样式时,它返回正确的答案。如果我以自定义方式设置日期格式化程序;答案是错误的。无法将两个日期与自定义进行比较iOS中的格式化程序?
if ([date1 isEqualToDate:date2]) { }
这是比较两个日期的简单方法......
You can try this if ([date1 compare:date2]==NSOrderedSame) { }