I'm using Objective-C for iPhone development and I'm wondering how to create a method that checks something (maybe make a GET request to some API every hour) even when the app closed.
Is there any built-in mechanism that can do that?
I'm using Objective-C for iPhone development and I'm wondering how to create a method that checks something (maybe make a GET request to some API every hour) even when the app closed.
Is there any built-in mechanism that can do that?
"Run always?" What does that mean? If you have a "while (true) block in your program it will lock up and the system will kill it for being frozen.
iOS devices are event driven, and need processor time to respond to user actions and system events.
Probably your best bet is a repeating timer on a fairly short interval. I would advise against making the interval much shorter than 50 times a second though, since timers aren't accurate at intervals shorter than that.
What is the problem you're trying to solve?