[MonoTouch] Get Data automatically ?
Rolf Bjarne Kvinge
rolf at xamarin.com
Wed Oct 26 05:20:10 EDT 2011
Hi,
Have a look at System.Threading.ThreadPool.QueueUserWorkItem.
In code it would be something like this:
ThreadPool.QueueUserWorkItem ((v) =>
{
while (!stop) {
LoadMyData ();
Thread.Sleep (2000); // wait for 2 seconds
}
});
You should also read this: http://docs.xamarin.com/ios/advanced_topics/threading
I hope this helps,
Rolf
On Tue, Oct 25, 2011 at 3:14 PM, Morpheusse
<sebastien.nocaudie at gmail.com> wrote:
> *Hi everyone,
>
> I am new to Monotouch and i need your help to develope my App.*
>
> *I have a function that retreive data from an XML file :*
>
>
>
> *Now, i put this function in ViewDidLoad () and its execute only one time
> when i lunch the app.
> *
> *And i want to execute this function every 2 second in my app.
> *
> *I suppose, i need to use thread but i dont know exactly how to do it.*
>
> --
> View this message in context: http://monotouch.2284126.n4.nabble.com/Get-Data-automatically-tp3936707p3936707.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>
More information about the MonoTouch
mailing list