iOS Guides | Samples

Foundation.ExportAttribute Class

Exports a method or property to the Objective-C world.

See Also: ExportAttribute

Syntax

[System.AttributeUsage(System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property)]
public class ExportAttribute : Attribute

Remarks

This attribute is applied to properties and methods in classes that derive from NSObject to export the value to the Objective-C world. This can be used either to respond to messages or to override an Objective-C method.

C# Example

public class Test : SomeBaseClass {
    [Export ("setText:withFont:")]
    public void SetText (string text, string font)
    {
    }
}

Requirements

Namespace: Foundation
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0

The members of Foundation.ExportAttribute are listed below.

See Also: Attribute

Public Constructors

Exports the given method or property to Objective-C land with the specified method name.
Use this method to expose a C# method, property or constructor as a method that can be invoked from Objective-C.

Protected Constructors

Use this method to expose a C# method, property or constructor as a method that can be invoked from Objective-C.

Public Properties

ArgumentSemanticArgumentSemantic. The semantics for object ownership on setter properties or methods.
IsVariadicBoolean.
SelectorString. The name of the C# selector if specified, or null if it is derived from the property name or method.

Public Methods