iphone - How do I set the click method on a TTButton? -
i'm using ttcatalog , creating ttbutton using following:
ttbutton *button = [ttbutton buttonwithstyle:@"toolbarbutton:" title:@"click button"]; i tried adding target , action that, doesn't work. how use it?
you missing "[".
ttbutton *button = [ttbutton buttonwithstyle:@"toolbarbutton:" title:@"click button"]; [button setuserinteractionenabled:yes]; [button addtarget:self action:@selector(buttonpressed:event:) forcontrolevents:uicontroleventtouchupinside]; then set button properties, use target/action set event handler. (the ttbutton uievent subclass.)
good luck!
Comments
Post a Comment