rubymotion-community / sugarcube

Some sugar for your cocoa. RubyMotion helpers.
Other
422 stars 66 forks source link

button.on(:touch) {} raise an exception #163

Closed mariochavez closed 10 years ago

mariochavez commented 10 years ago

Hi,

I'm using sugarcube version 2.6.0, I'm requiring sugarcube-events in my Gemfile but when I try to add a listener to the touch event I got:

*** Terminating app due to uncaught exception 'TypeError', reason: 'uicontrol.rb:20:in `block in on:': can't convert Symbol into Integer (TypeError)

I'm not sure what I'm missing here.

@button.on(:touch) { puts 'hi' }
colinta commented 10 years ago

Oh you just need to include sugarcube-constants On Sep 25, 2014 5:58 PM, "Mario Alberto Chavez" notifications@github.com wrote:

Hi,

I'm using sugarcube version 2.6.0, I'm requiring sugarcube-events in my Gemfile but when I try to add a listener to the touch event I got:

*\ Terminating app due to uncaught exception 'TypeError', reason: 'uicontrol.rb:20:in `block in on:': can't convert Symbol into Integer (TypeError)

I'm not sure what I'm missing here.

@button.on(:touch) { puts 'hi' }

— Reply to this email directly or view it on GitHub https://github.com/rubymotion/sugarcube/issues/163.

mariochavez commented 10 years ago

Thanks for your help !

dubcanada commented 9 years ago

I had this same error, could you add that you need to require constants to the readme for the events section, as right now it just says require 'sugarcube-events'

Just to prevent others from also stumbling into this.

colinta commented 9 years ago

Ah good point. Will do - or, I always encourage pull requests, especially for documentation! :-)

On Dec 10, 2014, at 9:44 PM, dubcanada notifications@github.com wrote:

I had this same error, could you add that you need to require constants to the readme for the events section, as right now it just says require 'sugarcube-events'

Just to prevent others from also stumbling into this.

\ Reply to this email directly or view it on GitHub.