ios - RubyMotion undefined method `addTarget' for #<UIRoundedRectButton:0x761fd40> -


i following motioncasts screencast at: http://motioncasts.tv/start-building-views-in-rubymotion/

and there code:

button = uibutton.buttonwithtype(uibuttontyperoundedrect) button.frame = [[15, 300], [280,50]] button.settitle("move next view", forstate: uicontrolstatenormal) button.addtarget(self,                  action: "movetochildview:",                  formcontrolevents: uicontroleventtouchupinside) 

which supposed work, when trying compile produces error:

(main)> 2013-04-18 18:41:06.205 12wbt[76267:c07] home_controller.rb:19:in `viewdidload': undefined method `addtarget' #<uiroundedrectbutton:0x761fd40> (nomethoderror)     app_delegate.rb:6:in `application:didfinishlaunchingwithoptions:' 2013-04-18 18:41:06.208 12wbt[76267:c07] *** terminating app due uncaught exception 'nomethoderror', reason: 'home_controller.rb:19:in `viewdidload': undefined method `addtarget' #<uiroundedrectbutton:0x761fd40> (nomethoderror)     app_delegate.rb:6:in `application:didfinishlaunchingwithoptions:' ' 

as far can tell, exact code screencast supposed work without error. wrong?

problem solved. last line should read forcontrolevents, not formcontrolevents.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -