[Mono-osx] how override an Objective C method?
gnorton at novell.com
Wed Oct 27 14:23:22 EDT 2010
> My best guess is this, but the app crashes inside the call to the base method.
> public override bool RespondsToSelector (Selector sel)
> bool result = base.RespondsToSelector(sel);
> return result;
As miguel said, you're wanting to bind a static method so you need something
public static bool RespondsToSelector (Selector sel)
/* put your custom logic here since you're overriding a static I presume you
have some */
bool result = Messaging.bool_objc_msgSend (Class.GetHandle
("WhateverYourSuperClassIs"), Selector.GetHandle ("respondsToSelector:"));
The bigger question is why do you want to override this method? It's very
odd that you would want to do this, since the NSObject instance and
objc-runtime should handle this for you.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-osx