Cast the current instance to the given type. The cast is dynamically tested for safety.

C# | Visual Basic | Visual C++ |
T CastTo<T>() where T : class, IManagedWrapper
Function CastTo(Of T As {Class, IManagedWrapper}) As T
generic<typename T> where T : ref class, IManagedWrapper T CastTo()

- T
- The type of the instance.

The cast instance

Exception | Condition |
---|---|
ObjectiveCClassCastException | If an error occured during the cast |

- Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)