Hi, is there any way to connect a control's action to a method defined in a MacRuby class in Xcode4? I can't see how could I do it - am I doing something wrong or is this a missing feature for now? (I don't even see any way to add the method to the list manually in IB...) JS
Are you defining the ‘action’ method with a ‘sender’ argument? Because that's the way it's picked up as being a method that should be exposed to IB. E.g.: def peelBananas(sender) # provide your optimized algorithm for peeling bananas end On 11 jun 2011, at 21:46, Jakub Suder wrote:
Hi,
is there any way to connect a control's action to a method defined in a MacRuby class in Xcode4? I can't see how could I do it - am I doing something wrong or is this a missing feature for now? (I don't even see any way to add the method to the list manually in IB...)
JS _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
On Sun, Jun 12, 2011 at 12:27, Eloy Duran <eloy.de.enige@gmail.com> wrote:
Are you defining the ‘action’ method with a ‘sender’ argument? Because that's the way it's picked up as being a method that should be exposed to IB. E.g.:
def peelBananas(sender) # provide your optimized algorithm for peeling bananas end
This is funny - I couldn't connect it in Xcode4, so I opened the same file in IB from Xcode3 instead, made the connection, saved the file, went back to Xcode4 - and now everything was working fine... I swear, before when I right-clicked on the object in the sidebar on the left, it showed some existing connections with an exclamation mark (as if suggesting that it can't see the method anymore) and when I tried to drag a connection from a control, the object didn't react on hover at all. And after I edited the file in IB3 this suddenly started to work as expected. JS
It sounds like you have both Xcode 3 and Xcode 4 on your system. Only the one installed to /Developer will get the MacRuby support in IB. Sent from my iDevice On 2011-06-12, at 17:05, Jakub Suder <jakub.suder@gmail.com> wrote:
On Sun, Jun 12, 2011 at 12:27, Eloy Duran <eloy.de.enige@gmail.com> wrote:
Are you defining the ‘action’ method with a ‘sender’ argument? Because that's the way it's picked up as being a method that should be exposed to IB. E.g.:
def peelBananas(sender) # provide your optimized algorithm for peeling bananas end
This is funny - I couldn't connect it in Xcode4, so I opened the same file in IB from Xcode3 instead, made the connection, saved the file, went back to Xcode4 - and now everything was working fine... I swear, before when I right-clicked on the object in the sidebar on the left, it showed some existing connections with an exclamation mark (as if suggesting that it can't see the method anymore) and when I tried to drag a connection from a control, the object didn't react on hover at all. And after I edited the file in IB3 this suddenly started to work as expected.
JS _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
participants (3)
-
Eloy Duran
-
Jakub Suder
-
Mark Rada