开发者

Fire action at specific date and time iPhone

开发者 https://www.devze.com 2023-04-09 16:37 出处:网络
in my Core Data model, I have an entity which has got a date attribute. For example, I\'ll set this date to 10/07/2011 4:00pm and I want to f开发者_如何学JAVAire an action when current date will pass

in my Core Data model, I have an entity which has got a date attribute. For example, I'll set this date to 10/07/2011 4:00pm and I want to f开发者_如何学JAVAire an action when current date will pass the saved date by one minute.

A local notification will be fired but I also want to fire another method to change another entity attribute's value. Is it possible to do something like this?

I've also thought to NSTimer but I've never used them... And a last question: will this action fire always even is app isn't in background or foreground?

Thank you so much!

Matteo


You can't fire an action while running in background mode other than through local notifications. To check if the date condition has been met while running in foreground, NSTimer is the way to go.


Try to check Local notifications

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号