NSHourCalendarUnit and NSMinuteCalendarUnit are deprecated. How to separate hours and minutes?

I have implemented NSCalendarUnit in my project to separate hours and minutes. Here is the code.

[calendar components:( NSHourCalendarUnit | NSMinuteCalendarUnit |  NSSecondCalendarUnit ) fromDate:[df dateFromString:[NSString stringWithFormat:@"%@",workendTime_txtfld.text]]];

      

In IOS8, NSHourCalendarUnit

, NSMinuteCalendarUnit

, NSSecondCalendarUnit

all of them are now out of date, how to deal with this problem. Please let me know the solution to this problem.

+3


source to share


2 answers


They were replaced by NSCalendarUnitMinute

, NSCalendarUnitSecond

etc. When you type NSMinuteCalendarUnit

into your code (Xcode 6.1 anyway) it should give you a warning that if you read it, the new values โ€‹โ€‹are.



+12


source


These are new calendar features.



 NSCalendarUnitSecond | NSCalendarUnitMinute | NSCalendarUnitHour |
 NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear;

      

+1


source







All Articles