MonoTouch.ObjCRuntime.AdoptsAttribute Class
An attribute used to specify that a class adopts a specific Objective-C protocol.

See Also: AdoptsAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true)]
public class AdoptsAttribute : Attribute

Remarks

You can use this attribute to decorate NSObject-derived classes to report back to the Objective-C runtime that the class adopts the specified Objective-C protocol.

Unlike C# interfaces, Objective-C protocols have optional components which means that they are not directly mapped to C# constructs. In both the MonoTouch and MonoMac bindings protocols are inlined directly into the classes that adopt the protocols which allow developers to invoke any methods adopted by the system classes.

User subclasses use this attribute when they want to explicitly inform the Objective-C runtime that they adopt the protocol. This attribute is looked up by the NSObject.ConformsToProtocol method.

Requirements

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