iOS Guides | Samples

MonoTouch.UIKit.UIKitThreadAccessException Class

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

See Also: UIKitThreadAccessException Members

Syntax

public class UIKitThreadAccessException : Exception

Remarks

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.

Requirements

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

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

See Also: Inherited members from System.Exception

Public Constructors