I am trying to determine the best web service polling strategy once per minute, parse the returned xml and then update the object stored in the shared instance. This process should be launched in a separate thread and will continue until the application is launched.
It seems that I could translate all the code into a webservice call and parse the xml in NSOperation and add NSOperation to the NSOperationQueue stored in the application delegate as soon as the application starts.
Is it correct to use NSTimer inside the main NSOperation method so that the operation is performed once a minute, indefinitely? In this case, NSOperation will never return - it seems that I want, but I'm not sure if this is the right way to think about it.
The problem I'm trying to solve is, of course, extremely widespread, so I'm trying to figure out the correct way to implement it. Any advice really appreciated.
source
share