The way I do my web services is to add the asynchronous interface and then just give it a delegate for completion and then call the begin method.
Sent from my iPhone On Sep 19, 2011, at 5:12 AM, Mittchel Van Vliet <[email protected]> wrote: > Hello everyone, > > Currently I am working with webservices in Monodroid and MonoTouch.. but I've > got one problem: > With webservices sometimes you've the problem that a webservice needs time to > load, so the solution is to put in a thread right? > > But I've only seen tutorials where you put a solid amount of seconds the > thread sleeps.. but how can you let him sleep until it recieves data? > Because if I do the following: > > thread.Sleep(10000); > service.getUsers(); > > And the service is done in 5 seconds, then the thread sleeps for another 5 > extra seconds.. > Another danger is that if the thread sleeps for 10 seconds, and the method > takes 5 seconds.. then the app will crash.. > > So how am I able to let the thread sleep until the method recieves data, like > Facebook apps does? > > Greetings! > _______________________________________________ > Monodroid mailing list > [email protected] > > UNSUBSCRIBE INFORMATION: > http://lists.ximian.com/mailman/listinfo/monodroid _______________________________________________ Monodroid mailing list [email protected] UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
