使用未解析的标识符NSCalendarUnitDay [英] Use of unresolved identifier NSCalendarUnitDay
本文介绍了使用未解析的标识符NSCalendarUnitDay的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚将Xcode更新到了6.3版本.
I just updated Xcode to its 6.3 version.
除了我必须针对as
进行的所有修复(主要是)外,我还有一些警告刚刚出现(这很奇怪,因为它声明自iOS 8.0以来).
Except all the fixes I have to make regarding as
(mainly), I have some warnings that just appeared (which is weird as it states it is since iOS 8.0).
我的代码
NSCalendar.currentCalendar().compareDate(self, toDate: date, toUnitGranularity: .DayCalendarUnit) == .OrderedAscending
现在显示警告
'DayCalendarUnit' was deprecated in iOS version 8.0: Use NSCalendarUnitDay instead
好,然后我将.DayCalendarUnit
更改为NSCalendarUnitDay
现在我收到一条错误消息:
Now I get an error saying:
Use of unresolved identifier 'NSCalendarUnitDay'
我很困惑,有人可以向我解释哪里出了问题以及如何解决吗?
I'm confuse, can someone explain me what's wrong and how to fix it?
推荐答案
使用.CalendarUnitDay
. NSCalendar是一个本机的Objective-C框架,错误消息并不迅速.
Use .CalendarUnitDay
. NSCalendar is a native Objective-C framework and the error messages aren't for swift.
这篇关于使用未解析的标识符NSCalendarUnitDay的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文