Cast the current instance to the given type. The cast is dynamically tested for safety.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public T CastTo<T>() where T : class, IManagedWrapper
Public Function CastTo(Of T As {Class, IManagedWrapper}) As T
public: generic<typename T> where T : ref class, IManagedWrapper virtual T CastTo() sealed
Generic Template Parameters
- T
- The type of the instance.
Return Value
The cast instance
Exceptions
Exception | Condition |
---|---|
ObjectiveCClassCastException | If an error occured during the cast |
Version Information
- Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)