I fixed a bug in your fix and improved it, so that we will automatically
register the given protocol in the class, therefore the second call to
conformsToProtocol: will be faster.
Please give it a try guys, it should be available in tonight's nightly build.
Laurent
On Nov 22, 2010, at 3:12 PM,
I just pushed a fix for this which checks if the class, or instance, implements
the required methods for the protocol given to conformsToProtocol:. Please give
it a try :)
Eloy
On 22 nov 2010, at 02:53, Laurent Sansonetti wrote:
> I commented the #999 ticket, I believe there is a way to make M
I commented the #999 ticket, I believe there is a way to make MacRuby classes
automatically conform to protocols (once all required methods are implemented).
Let's try to get that done for the upcoming release :)
Laurent
On Nov 20, 2010, at 2:28 PM, Charles Steinman wrote:
> In case anyone nee
In case anyone needs it in the meantime, here is a working
implementation of conformsToProtocol:
def conformsToProtocol(protocol)
supported = %w( AProtocol SomeOtherProtocol YetAnotherProtocol
).map {|name| Protocol.protocolWithName name} # List the protocols you
want to conform to between the
Regardless of the current state, having a real Protocol class and objects that
you can use to check against should be the goal. Let's discuss this further on
the ticket from now on, for completeness sake.
On Nov 17, 2010, at 12:44 PM, Thibault Martin-Lagardette wrote:
> These structures are cur
These structures are currently handled by Foundation's BridgeSupport file
(/System/Library/Frameworks/Foundation.framework/Resources/BridgeSupport/Foundation.bridgesupport)
It's not very humanly readable, but MacRuby understands what this means, and
then knows NSPoint is a struc
Thanks for opening a ticket and describing the issue so well!
I'm not sure how this should be solved, but I was wondering how things
currently work for other C structs like NSRect or NSPoint. Are these handled as
special cases, or is there a more general way to deal with C structs?
Would it ma
This is because protocols, in the Obj-C runtime, are not Obj-C objets per say,
they are C structs.
+protocolWithName returns an (id) (aka obj-c objet), but the actual returned
pointer is just a pointer to a C struct, which causes the runtime to issue
those warnings. It says "Hey, this method ret
Can you provide a simple failing example?
On Nov 17, 2010, at 9:26 AM, Martijn Walraven wrote:
> I actually tried this, but the problem seems to be that Protocol is not a
> true class. So if I try to do anything with the protocol parameter from
> MacRuby, I get an error:
>
> *** NSInvocation:
I actually tried this, but the problem seems to be that Protocol is not a true
class. So if I try to do anything with the protocol parameter from MacRuby, I
get an error:
*** NSInvocation: warning: object 0x7fff71192488 of class 'Protocol' does not
implement methodSignatureForSelector: -- troub
I don't have an example of a class that uses conformsToProtocol: on the
delegate, so I can't give you a code example, but I would try to override the
conformsToProtocol: class and instance methods and return true for those you
support.
On 15 nov 2010, at 00:15, Martijn Walraven wrote:
> Hi,
>
Hi,
I was wondering if there is any way to formally indicate a MacRuby class
conforms to an Objective-C protocol. I encountered some code that uses
conformsToProtocol: instead of respondsToSelector: as a check before invoking
delegate methods, and the only way I could get a delegate written in
12 matches
Mail list logo