views:

49

answers:

2

Hi..

I need to do an automatic webservice request every second in my application to maintain my 3g connection. Anyone got any pointers on how to do this effectively?

Thanks!

+1  A: 

The NSTimer class should be able to do what you need. There are lots of other questions on SO about connecting to a web service so I won't answer that bit here.

Stephen Darlington
+1  A: 

Have a look at Run Loops.

Kai
Thank you fro marking this one as 'right'. But I'd like to mention, that I really recommend to avoid concurrency and look for another solution. Do really need to test your connection every second. Isn't it good enough to test it when it's needed and react in an appropriate way if it's not there?
Kai
I asked for pointers and the article on Run Loops looks very promising ;) (I´m reading through it atm.)And yes, i need to test the 3G connection every second, or at least very often. The application is dependent on a 3G connection to go smoothly, and if the 3G connection goes down it takes too much time to reconnect to the operator.
Madoc