UIKit.UIKitThreadAccessException Class
Exception thrown when a UIKit API is invoked from a background thread.

See Also: UIKitThreadAccessException Members


public class UIKitThreadAccessException : Exception


The exception is thrown if some background code has called into a UIKit API that is not thread safe. In general, most UIKit APIs are not thread safe and should not be invoked from a background thread. If you must invoke a UIKit method from a background thread, you should consider queueing a task using the Foundation.NSObject.BeginInvokeOnMainThread(Foundation.NSAction) method.

It is possible to disable the runtime check by setting the UIApplication.CheckForIllegalCrossThreadCalls field to false.

This exception is thrown by dll in debug builds, or in release builds that have been compiled with the --force-thread-check flag.


Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: