English 中文(简体)
Setting end date for repeating local notification in iPhone OS4 SDK
原标题:

In the iPhone OS4 SDK, does anyone have a suggestion for how I would implement a repeating local notification that ends on a particular date?

Looking at the API documentation, there doesn t appear to be a built-in property of UILocalNotification to allow you to set an end date on a repeat.

Any suggestions would be much appreciated.

Thank you!

最佳回答

Two ways that you could go about it:

Track the end date in your app. Whenever the app launches, check for notifications which are now "expired" and call cancelLocalNotification on them.

Alternatively, instead of using the repeatInterval property of the notification, manually schedule the x number of repeat notifications.

问题回答

Set notification for each repeat date and check programatically that repeat date is not greater than end date by NSDateComparator.





相关问题
Alert email in TFS and power tools

I have a problem with TFS and email notifications. I can not receive any emails from TFS server for work item tracking. I correctly have configured web.config in ...Web ServicesServices in TFS ...

3 notifications instead of one

I m developing simple MVC app in Cocoa/Objective-C. I have a strange issue (or misunderstanding) with notifications and KVO. I have AppController object in MainMenu.xib, hence I implement ...

Notification when laptop is switch on (boot)

I need to know, is that possible to get a notification through email whenever my laptop is switched on or is connected to internet ? An alternative is to get notification when set service Starts on ...

Feedback service for Push notification

I wrote the below script to read the feedback data. But, for some reasons, I am not receiving any data from the server. Can you kindly let me know whats wrong with the script. Also, if you have any ...

热门标签