I want to ask a question about the iPhone application. I am writing a program which can upload some information to a server. However, the user has to click a button before the upload. Therefore, is it possible for the application to upload the data to server regularly after the user only click one time of the button?
It means that the app will upload the data at 12:00 p.m, 12:00 am …. Thank you.
It is possible if and only if your app run all the time. Otherwise, if users quit your app then you cannot set and run any code inside your app. You also cannot set any timer inside iphone to run your app.
So, if the user open your app in the time. Then you can use NSTimer to schedule the time to upload your data. If user quit, you stored the last time you upload data, then when user open your app again, you check for the last time uploading and if it is too old, you upload data again.
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds invocation:(NSInvocation *)invocation repeats:(BOOL)repeatsMore here