Forum Xamarin Xamarin.iOS

How to update ViewController fields in real-time in Xamarin.iOS

DanDickersonDanDickerson USMember ✭✭

I need to update fields in a ViewController every 100 msec.
I tried setting a timer in the main application, but it required that the Screen Update routine in the ViewController be static. When it was set to static, it could not reference the individual fields.
When I tried setting a timer in the ViewController, I got the exception:
UIKit.UIKitThreadAccessException: UIKit Consistency error: you are calling a UIKit method that can only be invoked from the UI thread.

What is the proper way to update the screen? I don't want to refresh the entire screen, it is only certain elements of the screen that need to be updated.

Is there a way to implement DataBinding in Xamarin.iOS? (I know that it is available in Xamarin.forms, but we are not using that.)

Best Answer

Answers

Sign In or Register to comment.