Use of unresolved identifier NSCalendarUnitDay

后端 未结 3 672
被撕碎了的回忆
被撕碎了的回忆 2020-12-19 11:31

I just updated Xcode to its 6.3 version.

Except all the fixes I have to make regarding as (mainly), I have some warnings that just appeared (which is we

相关标签:
3条回答
  • 2020-12-19 11:38

    Use .CalendarUnitDay. NSCalendar is a native Objective-C framework and the error messages aren't for swift.

    0 讨论(0)
  • 2020-12-19 11:41

    in Xcode 7.3 use .Day which is a property of NSCalendarUnit struct

    0 讨论(0)
  • 2020-12-19 11:51

    I think Apple thought the name of those units weren't meaningful like .DayCalendarUnit, so they have modified it to sound more sensible and explanative as .CalendarUnitDay.

    Similar modifications have been done in Objective-C. NSDayCalendarUnit is deprecated and you have to use NSCalendarUnitDay.

    The problem in your case is that you are receiving deprecation warning of Objective-C instead of Swift. We hope Apple fixes it soon.

    Hope that explains...

    0 讨论(0)
提交回复
热议问题