[MacRuby-devel] programatic binding (undefined bind method on NSTextField)

Alex Greif alex at greifdesign.net
Wed Sep 28 00:48:09 PDT 2011


I am on 10.6.8
I tried with the 0.10 and the nightly build from 2011.9.27 and with both
versions I get a "false" for the following statements in the macruby irb

I have installed Xcode 3.2.4

Any Ideas why this does not work?


--------- 0.10 -------------
$ macirb
irb(main):001:0>
NSObject.alloc.init.respond_to?('bind:toObject:withKeyPath:options:')
NSObject.alloc.init.respond_to?('bind:toObject:withKeyPath:options:')
=> false


--------- installed nightly build ---------------
$ macruby --version
MacRuby 0.11 (ruby 1.9.2) [universal-darwin10.0, x86_64]
$ macirb
irb(main):001:0>
NSObject.alloc.init.respond_to?('bind:toObject:withKeyPath:options:')
NSObject.alloc.init.respond_to?('bind:toObject:withKeyPath:options:')
=> false





> Have you got the right signature? Looking at
>
> http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Protocols/NSKeyValueBindingCreation_Protocol/Reference/Reference.html
>
> I see only
>
>   bind:toObject:withKeyPath:options:
>
> and on Lion with macruby_nightly-2011-09-23 I get:
>
> irb(main):014:0>
> NSObject.alloc.init.respond_to?('bind:toObject:withKeyPath:options:')
> => true
> irb(main):015:0>
> NSTextField.alloc.initWithFrame([1,2,3,4]).respond_to?('bind:toObject:withKeyPath:options:')
> => true
>
> Cheers,
> Sven
>
>> The following code prints false twice
>> So it seems that the protocol is not applied correctly.
>> Is this a bug or do I need some other require/framework statements?
>> BTW the result is the same if i use "framework 'Cocoa'"
>> -------- code -------------
>> framework 'AppKit'
>>
>> puts NSObject.alloc.init.conformsToProtocol
>> Protocol.protocolWithName('NSKeyValueBindingCreation')
>>
>> puts NSTextField.alloc.initWithFrame([1,2,3,4]).conformsToProtocol
>> Protocol.protocolWithName('NSKeyValueBindingCreation')
>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>





More information about the MacRuby-devel mailing list