In the app I'm making I need objects to delete themselves after a certain amount of time in Parse. I'm pretty sure I need an NSTimer but I'm not positive. Is there anyone that could help me? Thanks
答案 0 :(得分:1)
You can do it with NSTimer
, but depending on your use case, that may not be ideal.
NSTimer
will stop running in the background after a specific amount of time. See: How to run NSTimer in background beyond 180sec in iOS 7?
Futhermore, if your app is not running, you will not be able to do this time based deletion in your Parse database.
What is ideal is to have background jobs
running in the Parse cloud. See: http://blog.parse.com/announcements/introducing-background-jobs/
and the Parse documentation for further details.