Iphone-MultiButton-Events -


i have 1 xib file in there 50 buttons..

and have same functionality... on click change background image (select)and... , second time click change background packet (deselect) ..

if make button own events .. it's ok..

but want create single function handles buttons...

i try it.. can't specific typecasting

coding

.h file

-(ibaction) btnshppress:(id)sender; 

.m file

-(ibaction) btnshppress:(id)sender {     uibutton *btnshp= (uibutton * ) sender;     nsstring *str = btnshp.name; //here ca't specific object } 

and apply event on 4 buttons - touchdown events

-(ibaction) btnshppress:(id)sender {     uibutton *btnshp= (uibutton * ) sender;     nsstring *str = [btnshp currenttitle]; //this gives title of button } 

you can set tag , access them using button.tag


Comments