简体   繁体   English

不推荐使用NSHourCalendarUnit和NSMinuteCalendarUnit。 如何分摊小时和分钟?

[英]NSHourCalendarUnit and NSMinuteCalendarUnit are deprecated. How to split up hours and minutes?

I have implemented NSCalendarUnit in my project to split hours and minutes . 我在我的项目中实现了NSCalendarUnit来分解小时和分钟。 Here is the code.. 这是代码..

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

In IOS8, NSHourCalendarUnit , NSMinuteCalendarUnit , NSSecondCalendarUnit these all are deprecated now how to handle this issue. 在IOS8, NSHourCalendarUnitNSMinuteCalendarUnitNSSecondCalendarUnit这些都已被弃用,现在如何处理这个问题。 Kindly let me know the solution for this issue.. 请让我知道这个问题的解决方案..

它们已被NSCalendarUnitMinuteNSCalendarUnitSecond等替换。当你在代码中输入NSMinuteCalendarUnit (无论如何在Xcode 6.1中),它应该给你一个警告,如果你读它,它会告诉你新的值。

These are new functions of calendar. 这些是日历的新功能。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将当前时间分成3个字符串; 小时,分钟和秒 - How do I split the current time into 3 strings; hours, minutes, and seconds iOS 7:不建议使用MPMusicPlayerController卷。 现在如何更改设备音量? - iOS 7: MPMusicPlayerController volume deprecated. How to change device volume now? 如何解决错误 OpenGLES 已弃用。 考虑改用 Metal - How to Solve the Error OpenGLES is deprecated. Consider migrating to Metal instead 如何只花数小时和数分钟 - How to get only hours and minutes 不推荐使用CFURLCreateDataAndPropertiesFromResource。 并寻找替代品 - CFURLCreateDataAndPropertiesFromResource deprecated. And looking for substitute SKPayment paymentWithProductIdentifier已过时。 备择方案? - SKPayment paymentWithProductIdentifier Deprecated. Alternatives? 如何从NSDate倒数并以小时和分钟显示 - How to countdown from a NSDate and display it in hours and minutes 如何从3.875小时中分离和存储小时和分钟 - How to separate and store hours and minutes from 3.875 hours 不推荐使用UITextInputMode currentInputMode。 建议更换? - UITextInputMode currentInputMode is deprecated. Suggested replacement? willRotateToInterfaceOrientation:不建议使用持续时间。 实现viewWillTransitionToSize:withTransitionCoordinator - willRotateToInterfaceOrientation:duration is deprecated. Implement viewWillTransitionToSize:withTransitionCoordinator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM