作者:729453686_5be5b9 | 来源:互联网 | 2023-07-23 14:41
ImaddingrepeatingeventstoaCocoaappImworkingon.Ihaverepeateverydayandweekfinebec
I'm adding repeating events to a Cocoa app I'm working on. I have repeat every day and week fine because I can define these mathematically (3600*24*7 = 1 week). I use the following code to modify the date:
我正在为一个Cocoa应用程序添加重复事件。我每天和每周都在重复,因为我可以用数学方法来定义(3600*24*7 = 1周)。我使用以下代码修改日期:
[NSDate dateWithTimeIntervalSinceNow:(3600*24*7*(weeks))]
I know how many months have passed since the event was repeated but I can't figure out how to make an NSDate object that represents 1 month/3 months/6 months/9 months into the future. Ideally I want the user to say repeat monthly starting Oct. 14 and it will repeat the 14th of every month.
我知道事件重复了多少个月,但我不知道如何制作一个NSDate对象,它表示未来1个月/3个月/6个月/9个月。最理想的情况是,我希望用户每月从10月14日开始重复每月的第14次。
5 个解决方案