iOS Guides | Samples

MonoTouch.UIKit.UIKitThreadAccessException Class

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

See Also: UIKitThreadAccessException


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 NSObject.BeginInvokeOnMainThread(NSAction) method.

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

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


Namespace: MonoTouch.UIKit
Assembly: monotouch (in monotouch.dll)
Assembly Versions:

The members of MonoTouch.UIKit.UIKitThreadAccessException are listed below.

See Also: Exception

Public Constructors