MonobjcMonobjc Documented Class Library
ObjectiveCClassAttribute Class
NamespacesMonobjcObjectiveCClassAttribute

Allows a .NET class to be registered within the Objective-C runtime.

All the ascendant classes in the inheritance hierarchy must have a ObjectiveCClassAttribute attribute, otherwise the runtime will not be able to use it.

Declaration Syntax
C#Visual BasicVisual C++
public sealed class ObjectiveCClassAttribute : Attribute
Public NotInheritable Class ObjectiveCClassAttribute _
	Inherits Attribute
public ref class ObjectiveCClassAttribute sealed : public Attribute
Members
All MembersConstructorsMethodsProperties



IconMemberDescription
ObjectiveCClassAttribute()()()()

Initializes a new instance of the ObjectiveCClassAttribute class.

The name that will be used to register the tagged type will be its short name, i.e. "MyType" if the type is "Foo.Bar.MyType".


ObjectiveCClassAttribute(String)
Initializes a new instance of the ObjectiveCClassAttribute class.

Equals(Object)
Returns a value that indicates whether this instance is equal to a specified object.
(Inherited from Attribute.)
Finalize()()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GetHashCode()()()()
Returns the hash code for this instance.
(Inherited from Attribute.)
GetType()()()()
Gets the Type of the current instance.
(Inherited from Object.)
InterceptCallsFor Obsolete.

Gets or sets the name of the class whose methods will be intercetped by this class.

The Objective-C runtime allows method replacement. It is useful to introduce a new behaviour wihtin a class hierarchy or to intercept messages.


InterceptDealloc
Gets or sets a value indicating whether this class needs dealloc interception.

IsDefaultAttribute()()()()
When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
(Inherited from Attribute.)
Match(Object)
When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
(Inherited from Attribute.)
MemberwiseClone()()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
Name
Gets the name to use when registering this class in the Objective-C runtime.

ToString()()()()
Returns a String that represents the current Object.
(Overrides Object.ToString()()()().)
TypeId
When implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute.)
Examples

The following example shows how to use the ObjectiveCClassAttribute attribute.

The type MyOwnType1 will be registered with the "MyOwnType1" name.

CopyC#
[ObjectiveCClass]
public class MyOwnType1 : NSObject
{
...
}

The type MyOwnType2 will be registered with the "Type2" name.

CopyC#
[ObjectiveCClass("Type2")]
public class MyOwnType2 : NSObject
{
...
}

Inheritance Hierarchy
Object
Attribute
 ObjectiveCClassAttribute
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)

Assembly: Monobjc (Module: Monobjc)