Hi,
I tried to put the "binding" code inside this block as you sugested:
InvokeOnMainThread( delegate {
// Update UI Code (in Main thread) from the new thread.
});But it doesn't work. So I used a non async method to download the string
(DownloadString method of the WebClient instance).
That works!
But if I do so, how do I display some kind of "loading" information in the main
UI thread?
Thanks!
Jesús Bosch Ayguadé
http://www.plungeinteractive.com
http://www.facebook.com/plungeinteractive
Date: Sun, 15 May 2011 04:22:04 -0400
Subject: Re: [MonoTouch] Databinding a Table View
From: [email protected]
To: [email protected]
Try executing the binding on the main thread. See the threading excerpt at
http://monotouchexamples.com/ .
You may also have an issue if it truly is running on a different thread as the
data may be getting nuked before you can use it (note the AutoReleasePool
object in the example). Checking your program output after running may give a
clue (if it's getting garbage collected w/o a pool you'll see a bunch of "Just
Leaking" messages).
Sorry I'm not more help here – if I had the time I'd set up a sample program
and try it. Then I could supply better answers.
-pete m.
From: Jesús Bosch Ayguadé <[email protected]>
Date: Sun, 15 May 2011 10:16:14 +0200
To: MonoTouch List <[email protected]>
Subject: [MonoTouch] Databinding a Table View
Hello,
This is what I do:
1- In the "FinishedLaunching" event, I do a request for a remote XML using a
WebClient object.2- When the Webclient event DownloadStringCompleted is raised,
(after the finished launching event, because it is asyncronous), I try to bind
the table view
Well, nothing happens (the items do not appear in the table view). If I try to
"bind" the table view inside the "finishedlaunching" event manually with the
same data (not the remote one), it works!! I think that must be because the
downloadstringcompleted event should be in a thread different than the UI one,
but I'm new in mono touch and I'm not sure. Any advise?
Thanks! :)
Jesús Bosch Ayguadé
http://www.plungeinteractive.com
http://www.facebook.com/plungeinteractive
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch