EKAlarm 不会在 iOS 5 中设置

EKAlarm will not set in iOS 5(EKAlarm 不会在 iOS 5 中设置)
本文介绍了EKAlarm 不会在 iOS 5 中设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了以下代码片段来创建一个事件.设置闹钟在 iOS 4 中工作正常,但在 iOS 5 中没有设置.这是一个错误还是我错过了什么?

I wrote the following snippet to create an event. Setting the alarm works fine in iOS 4, but in iOS 5 it doesn't get set. Is this a bug or am I missing something?

EKCalendar *cal = [self.eventStore defaultCalendarForNewEvents];
EKEvent *event = [EKEvent eventWithEventStore:self.eventStore];
event.calendar = cal;
// .......
EKAlarm *alarm = [EKAlarm alarmWithRelativeOffset:-3600];
event.alarms = [NSArray arrayWithObject:alarm];
// .......

推荐答案

我遇到了同样的错误.

问题似乎是 startDate 不应该与 endDate 相同......真是愚蠢的 iOS 变化!

The problem seems that startDate shoudln't be the same as endDate... really silly iOS change!

这篇关于EKAlarm 不会在 iOS 5 中设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)