Question: From the documentation of a bound API I'm using:

> 
> overrideClassNames
> 
> 
> Use this to use specific subclasses instead of the default PSPDF\*
>  classes. e.g. add an entry of [PSPDFAnnotationParser class] /
>  [MyCustomAnnotationParser class] as key/value pair to use the custom
>  subclass. (MyCustomAnnotationParser must be a subclass of
>  PSPDFAnnotationParser) Throws an exception if the overriding class is
>  not a subclass of the overridden class. Note: does not get serialized
>  when saved to disk.
> 
> 
> @property (nonatomic, strong) NSDictionary \*overrideClassNames
> 
> 
> 

Here's what I tried but doesn't work. Appearently not strings are required but actual types or something. How can I use this in MonoTouch?

```
var oClassDic = new NSMutableDictionary();
oClassDic.Add(new NSString("[PSPDFAnnotationParser class]"), new NSString("[PSPDFKitAnnotationParser class]"));
oDoc.OverrideClassNames = oClassDic;

```

The PSPDFKitAnnotationParser I created like this:

```
[Register("PSPDFKitAnnotationParser")]
    public class PSPDFKitAnnotationParser : PSPDFAnnotationParser
    {
        public PSPDFKitAnnotationParser () : base()
        {
        }

        public PSPDFKitAnnotationParser (PSPDFDocumentProvider provider) : base(provider)
        {
        }

        public PSPDFKitAnnotationParser (IntPtr handle) : base(handle)
        {
        }

        public PSPDFKitAnnotationParser (NSObjectFlag t) : base(t)
        {
        }

        public PSPDFKitAnnotationParser (NSCoder coder) : base(coder)
        {
        }

```

Answer: 
MonoTouch's own bindings generally hides the [`class`](https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html) and replace them with, the more .NETy, `System.Type`.

However the `MonoTouch.ObjCRuntime.Class` type exists and can also be used. If the native code expects `class` instances then you should be able to do something like:

```
var oClassDic = new NSMutableDictionary();
oClassDic.Add(new Class("PSPDFAnnotationParser"), new Class("PSPDFKitAnnotationParser"));
oDoc.OverrideClassNames = oClassDic;

```

You might have to tweak this a bit since a `Class` instance is not an `NSObject`, it's a `NativeObject` in MonoTouch, so you might have to go one level deeper and use the `Handle` properties (`IntPtr`) when adding values/keys to your dictionary.
Following @poupou answer this might work, I have not tested it this is what you have to do, It Works (TM)

```
var oClassDic = new NSMutableDictionary();
var key = new Class("PSPDFAnnotationParser");
var val = new Class("PSPDFKitAnnotationParser");

IntPtr selSetObjectForKey = Selector.GetHandle ("setObject:forKey:");

Messaging.void_objc_msgSend_IntPtr_IntPtr (oClassDic.Handle, selSetObjectForKey, val.Handle, key.Handle);

oDoc.OverrideClassNames = oClassDic;

```

Selector [setObject: forKey:](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSMutableDictionary_Class/Reference/Reference.html#//apple_ref/occ/instm/NSMutableDictionary/setObject%3aforKey%3a) expects an ObjC `id` type on both params

> 
> "id" its just a special type that can hold a pointer to any object you can construct with ObjC
> 
> 
> 

So this should work :)

Hope this helps

Alex