scheduling task in iphone

主宰稳场 提交于 2019-12-13 04:42:05

问题


I am developing an iphone app, there's a section in it where user can declare his task and its occurence in time. I.e. recursive task. The task will only show an alert box and nothing else when its due time. Its a kind of reminder, rather than a real task scheduler.

What's the best way or technology to achieve that with objective-c, particularly on iphone. I was also thinking, if not too time consuming to implement, about some kind of integration with iphone calendar. Would it be nice to have the app create its own calendar.

thanks


回答1:


I think this is one of the good methods to use. You can define the object and its selector so that after a period of time, the timer will call something like [targer performSelector:aSelector];

+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds target:(id)target selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats

More Details here




回答2:


You should look into using a Push Notification

More info: http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html



来源:https://stackoverflow.com/questions/3388781/scheduling-task-in-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!