[Mono-osx] [ANN] mcocoa 0.7 and mobjc 0.8

Lee V. Andrus landrus2 at by-rite.net
Mon Jan 11 18:26:13 EST 2010

Jesse Jones-2 wrote:
> On Jan 8, 2010, at 2:16 PM, Lee V. Andrus wrote:
>> On another note, I noticed that there are still no wrappers classes or
>> interfaces for Objective C Protocols, although their methods are wrapped
>> in
>> each class that "conforms to" them.  Methods in Category
>> NSDraggingDestination each have a parameter of type "id
>> <NSDraggingInfo>". 
>> Since no class that conforms to that Protocol is exposed in the framework
>> header files, nothing about it is generated by your generator.  I will
>> probably need to create my own set of extension methods to handle this.
> This has been on my list of things to do, but it's been a rather low
> priority because I have never come across a use case where I thought it
> would be useful. If you don't mind my asking, where do you think they
> would be useful?
In calling or overriding methods with parameter(s) of type "id
<pROTOCOLnAME>", like those of Category NSDraggingDestination.  Handling
Drag and Drop requires the application to override at least one method of
that Category and call methods of Protocol NSDraggingInfo.  A wrapper for
the Protocol would be very helpful.  But since there is no class in the
framework headers that conforms to it, your generator does not generate even
any example of what it might look like (although their form is not hard to
for someone who has peeked at your source code to deduce).

Sometimes the application needs to pass an argument that conforms to a
Protocol to a framework method.  NSPrintPanel's "-
(void)addAccessoryController: (NSViewController<NSPrintPanelAccessorizing>
*)accessoryController" is one such method for which there is no example in
the framework headers of a class conforming to the Protocol. A Mono
interface for the Protocol may be useful in creating the class that conforms
to it, although optional methods may complicate creating the class as a
formal implementation of the interface.

This brings up another point.  MCocoa wraps NSDraggingInfo with a class of
extension methods.  On the face of it, this is a close analogy of a
Category.  But the application program that uses these methods needs to
override them rather than call them.  An extension method wrapper is not
very useful for this.  A lot of Cocoa application programming involves
subclassing the framework classes and overriding methods--many of which are
defined in Categories.  But the extension methods seem harmless, and I am
not sure what might be generated that would be more useful.
View this message in context: http://old.nabble.com/-ANN--mcocoa-0.7-and-mobjc-0.8-tp26964532p27119773.html
Sent from the Mono - OSX mailing list archive at Nabble.com.

More information about the Mono-osx mailing list