MonobjcMonobjc Documented Class Library
ObjectiveCIVarAttribute Class
NamespacesMonobjcObjectiveCIVarAttribute

Exposes a field to the Objective-C runtime, so it can be manipulated from the runtime.

When the tagged type (with the ObjectiveCClassAttribute) is registered in the Objective-C runtime, all the tagged fields will be exported, which means they will be accessible from native classes.

Fields declared by ObjectiveCIVarAttribute are synchronized before and after method calls if required (see ObjectiveCMessageAttribute).

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



IconMemberDescription
ObjectiveCIVarAttribute()()()()
Initializes a new instance of the ObjectiveCIVarAttribute class.

ObjectiveCIVarAttribute(String)
Initializes a new instance of the ObjectiveCIVarAttribute 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.)
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 be used when the enclosing type is registered within 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 ObjectiveCIVarAttribute attribute.

CopyC#
[ObjectiveCClass]
public class MyOwnType1 : NSObject
{
[ObjectiveCIVarAttribute("myBool")]
public bool MyBool
{
get { return GetInstanceVariable<bool>("myBool"); }
set { SetInstanceVariablee<bool>("myBool", value); }
}
[ObjectiveCIVarAttribute("aString")]
public NSString aString
{
get { return GetInstanceVariable<NSString>("aString"); }
set { SetInstanceVariablee<NSString>("aString", value); }
}
public MyOwnType1()
{
...
}
...
}
Inheritance Hierarchy
Object
Attribute
 ObjectiveCIVarAttribute
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)