For consistency sake – be lazy.
If you have done any IOS development, especially if you’re like me and have started using Xamarin for everything, you’ve no doubt ran into the ubiquitous gem: UIKit Consistency Error: you are calling a UIKit method that can only be invoked from the UI thread. When I saw this in the logs for GetDealt, I immediately started to chastise myself. How could such a simple error get through the cracks? As I started parsing the stack trace, I noticed something interesting: The executing code was already wrapped in a InvokeOnMainThread() call. Wait, what? A double check revealed: this.InvokeOnMainThread(delegate() { //...Code Here... }); If you were sitting next to me when I discovered this, you too would have caused time to freeze as your mind succumbed to...
Read More