MonobjcMonobjc Documented Class Library
ObjectiveCEncoding Class
NamespacesMonobjcObjectiveCEncoding

Utility class to handle encoding of types and methods.

Declaration Syntax
C#Visual BasicVisual C++
public static class ObjectiveCEncoding
Public NotInheritable Class ObjectiveCEncoding
public ref class ObjectiveCEncoding abstract sealed
Members
All MembersMethods



IconMemberDescription
GetSelector(MethodBase)

Gets the selector for the given method.

The selector for a method is build with the following rules:

  • Selector begins with the method name
  • The first parameter if present is appended by its name with the "With" prefix
  • The other parameters if present are appended by their names

Here are some examples of result:
MethodCorresponding selector
public void DoThis()
DoThis
public void DoThis(int value)
DoThisWithValue:
public void DoThis(NSString str, int val)
DoThisWithStr:val:


GetSignature(MethodInfo)

Gets the signature for the given method.

Here are some examples of result for methods:
MethodCorresponding signature (on IA32 architecture)
public void DoThis()
v8@0:4
public void DoThis(int value)
v12@0:4i8
public void DoThis(NSString str, int val)
v16@0:4@8i12


GetTypeEncoding(Type)

Return the Objective-C encoding used to build selector signature.

Here are some examples of encoding:
TypeCorresponding encoding
void
v
int or Int32
i
NSString
@
int[]
^i
NSRect
{NSRect={NSPoint=ff}{NSSize=ff}}

For a full list of the encoding, refer to http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_5_section_7.html


GetTypeSize(Type)

Return the native type size used to build selector signature. The value represents the size to use when the type is placed on the parameter stack.

Here are some examples of sizes:
TypeCorresponding size (on IA32 architecture)
bool or Boolean
1
int or Int32
4
NSString
4
NSRect
16


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