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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -