[Mono-osx] how override an Objective C method?

Miguel de Icaza miguel at novell.com
Wed Oct 27 11:50:49 EDT 2010


Hello,

I want to override +(bool)[NSObject respondsToSelector:sel].
>

The signature above is for a static method, not an instance once (+ vs - in
the signature).


> My best guess is this, but the app crashes inside the call to the base
> method.
>
>        [Export("respondsToSelector:")]
>        public override bool RespondsToSelector (Selector sel)
>        {
>                bool result = base.RespondsToSelector(sel);
>                return result;
>        }
>

Do not use the [Export] if you are overriding an existing method that is
already defined.

Miguel.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20101027/e51379ce/attachment.html 


More information about the Mono-osx mailing list