Monotouch-取消本地通知
有人用它来取消之前安排的本地通知吗?我在文档中看到它,但无法将其连接到代码中。
UIApplication.SharedApplication.ScheduledLocalNotifications schedNoteList = new
UIApplication.SharedApplication.ScheduledLocalNotifications();
foreach(UILocalNotification sNote in schedNoteList)
{
if(sNote.FireDate == oldDate)
{
//Cancel the Notification
UIApplication.CancelLocalNotification(sNote);
}
}
谢谢, 瑞克
Anyone used this to cancel a previously scheduled Local Notification? I see it in the documentation but can't get it wired up in code.
UIApplication.SharedApplication.ScheduledLocalNotifications schedNoteList = new
UIApplication.SharedApplication.ScheduledLocalNotifications();
foreach(UILocalNotification sNote in schedNoteList)
{
if(sNote.FireDate == oldDate)
{
//Cancel the Notification
UIApplication.CancelLocalNotification(sNote);
}
}
Thanks,
Rick
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这段代码将编译:
但我不能说它是否会做你想要它做的事情(因为我主要使用 MonoDevelop 代码完成来重写你的代码)。
This code will compile:
but I cannot say if it will do what you want it to do (since I mostly reworked your code using MonoDevelop code completion).