I've got a DialogViewController, that's ViewDidAppear has this: (Note the commented out CreateScheduledTime/BeginInvokeOnMainThread and their closing brackets).
If you run the code, as is, it works fine, you'll have 20 red buttons with white text. Uncomment out the Threading code (to make the UI more responsive) and boom, the colors and attributes are all messed up, bleeding through, etc. My question is (not really knowing Cocoa) what's going on here? What are the rules of Threads and the UI? Thanks in advance. https://github.com/martinbowling/zxing.MonoTouch Root = new RootElement("Test Colored"); //NSTimer.CreateScheduledTimer (TimeSpan.FromSeconds (0), delegate { //BeginInvokeOnMainThread (delegate //{ Section buttons = new Section("Buttons"); for (int i=0; i<20; i++) { StyledStringElement se = new StyledStringElement(string.Format("Button {0}", i)); se.BackgroundColor = UIColor.Red; se.TextColor = UIColor.White; buttons.Add(se); } Root.Add(buttons); //}); //}); -- View this message in context: http://monotouch.2284126.n4.nabble.com/MonoTouch-Dialog-DialogViewController-and-Threads-tp3749886p3749886.html Sent from the MonoTouch mailing list archive at Nabble.com. _______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
