MonobjcMonobjc Documented Class Library
Monobjc Namespace
NamespacesMonobjc
The core engine of the Monobjc bridge.
Declaration Syntax
C#Visual BasicVisual C++
namespace Monobjc
Namespace Monobjc
namespace Monobjc
Types
All TypesClassesInterfacesEnumerations
IconTypeDescription
Block

Managed implementation of the blocks as defined in the Language Specification for Blocks[1]. Even if the implementation strictly follows the Block Implementation Specification[2], it is restricted to global block for the moment.

The block bridging allow a delegate function or action to be marshalled as a native block. Its implementation points to a proxy invoker that will forward the native block invocation to the delegate function or action.

Currently, any delegate can be passed to create a block. For example:

DelegateEquivalent block signature
Action
void (^)()
[!:Action{T1,T2,T3}]
void (^)(T1, T2, T3)
[!:Func{TResult}]
TResult (^)()
[!:Func{T1,T2,TResult}]
TResult (^)(T1, T2)

[1] Language Specification for Blocks (http://clang.llvm.org/docs/BlockLanguageSpec.txt)

[2] Block Implementation Specification (http://clang.llvm.org/docs/BlockImplementation.txt)


Class
Represents a managed wrapper around an Objective-C Class definition.

IBActionAttribute
Marks a method as an action for Interface Builder.

IBOutletAttribute
Marks a property as an outlet for Interface Builder.

Id

This type represents a native object in the Objective-C runtime and is referenced through a memory pointer.

For each managed instance is associated a native pointer that allows a two-way messaging between the .NET and the Objective-C runtime.


IdExtensions
Extensions methods for Id class, that are null friendly (i.e. a call on a null reference returns.

IdMarshaler<(Of <(<'TInstance>)>)>
Custom marshaller for Id instances. This makes interop a breeze as it cuts a lot of code.

IManagedWrapper
Interface to identity classes or interfaces that can act as a managed wrapper.

Logger

Very basic logger that handles four levels of log.

The levels are set through an environment variable MONOBJC_LOG_LEVEL. Output logs are printed in a Terminal console.

The levels are :

LevelAssociated Output
DEBUG (MONOBJC_LOG_LEVEL >= debug)
Low-level log (class registration, proxy creation, messaging, etc.). Beware that this level will slow down the execution.
INFO (MONOBJC_LOG_LEVEL >= info)
Output informationnal log (bridge starting, architectre and runtime selection, statistics, etc.). Beware that this level may slow down the execution.
WARN (MONOBJC_LOG_LEVEL >= warning)
Output warning log. There is no noticeable impact
ERROR (MONOBJC_LOG_LEVEL >= error)
Output error log. There is no noticeable impact

MacOSVersion
Enumeration that holds hexadecimal values for MacOS system version.

ObjectiveCCategoryAttribute

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

The extension methods are added as instance methods to the targeted class.


ObjectiveCCategoryMappingException
Exception raised if a category mapping failed.

ObjectiveCClassAttribute

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.


ObjectiveCClassCastException
Exception raised if a dynamic class cast failed.

ObjectiveCClassMappingException
Exception raised if a class mapping failed.

ObjectiveCCodeGenerationException
Exception raised if a dynamic code generation failed.

ObjectiveCEncoding

Utility class to handle encoding of types and methods.


ObjectiveCException
Exception raised if a something failed inside the bridge.

ObjectiveCFrameworkAttribute
Marks an assembly as a Mac OS X framework.

ObjectiveCIVarAttribute

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).


ObjectiveCMessageAttribute

Allows a method to be exported as part of a native class within the Objective-C runtime.

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


ObjectiveCMessagingException
Exception raised if a message passing failed.

ObjectiveCProtocolAttribute

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

When a native instance is returned, the Objective-C runtime provides a wrapper that allows calls to the native instance through the methods of the interface.


ObjectiveCRuntime

Entry point of the .NET/Objective-C bridge.

The runtime is responsible for:

  • The mapping between managed type and Objective-C classes
  • The mapping between managed instances and their native counterparts
  • The sending of message from .NET to Objective-C

A lot of magic occurs behind the scene to ensure that managed type and instances are seen as native in the Objective-C runtime.


ObjectiveCUnderlyingTypeAttribute

Used to define the underlying native type for a managed type.

This is needed in order to map types that can be dependent on the platform's bitness.


SelectorExtensions

Contains extension methods to ease the selector transformations.