iPhone equivalent of Application.DoEvents();

Posted by BahaiResearch.com on Stack Overflow See other posts from Stack Overflow or by BahaiResearch.com
Published on 2010-05-15T15:12:40Z Indexed on 2010/05/15 15:24 UTC
Read the original article Hit count: 294

Filed under:
|
|

iPHone: We use MonoTouch, but Obj-C answers are ok.

My singleton domain object takes a while to get all the data so it runs internally parts of the fetch in a thread.

I need to inform the UI that the domain is done. Currently I do this. Is there a better way? In WinForms I would call Application.DoEvents() instead of Thread Sleep.

PlanDomain domain = PlanDomain.Instance ();
while (domain.IsLoadingData)
{
    Thread.Sleep (100);  //this is the main UI thread
}

TableView.Hidden = false;
TableView.Source = new TableSource (this);
TableView.ReloadData ();

© Stack Overflow or respective owner

Related posts about iphone

Related posts about monotouch