Checking For Updates On Start (Synchronous)
Hello,
I'm looking for an example that will allow me to check for updates before loading the rest of the program. Basically a Synchronous method, or allow it to trigger a function after it has checked.
4 Answers
-
Almost nothing in the iPhone SDK happens synchronously, so you'll have to use a semaphore. Or just have the result of your process trigger your startup code.
Basically, you'll want to draw a simple screen with an activity indicator (see the Kitchen Sink for this) and have that screen do your update checking. When that completes (in the event handler that processes the results) you'll open the main window of the app.
-
This is for desktop. Thanks though.
-
Hey Bryce, it's possible to use Titanium.Network.HTTPClient synchronously ( http://developer.appcelerator.com/apidoc/desktop/1.0/Titanium.Network.HTTPClient.open.html ). The UpdateManager doesn't support synchronous ussge. That being said, I wouldn't recommend using it. HTTP requests can take quite a while to complete and the UI will hang and be unresponsive during that entire time. Perhaps there is another way to accomplish what you want?
-
Martin, do you have an example of how I could use Onupdate. I will try and work with async.