iphone - UITableView with 3x3 grid button subviews -


im struggling work efficiently. need 3x3 scrolling grid of buttons. need know of these buttons pressed , following when create new cell

    button1 = [uibutton buttonwithtype:uibuttontypecustom];     button1.frame = cgrectmake(20, 20, 80, 80);     button1.opaque = no;     button1.showstouchwhenhighlighted = no;     [button1 addtarget:self action:@selector(buttonclick:)       forcontrolevents:uicontroleventtouchupinside];     button1.tag = 0;     [foodcell.contentview addsubview:button1];       button2 = [uibutton buttonwithtype:uibuttontypecustom];     button2.frame = cgrectmake(120, 20, 80, 80);     button2.opaque = no;     button2.showstouchwhenhighlighted = no;     [button2 addtarget:self action:@selector(buttonclick:)       forcontrolevents:uicontroleventtouchupinside];         button2.tag = 1;     [foodcell.contentview addsubview:button2];       button3 = [uibutton buttonwithtype:uibuttontypecustom];     button3.frame = cgrectmake(220, 20, 80, 80);     button3.opaque = no;     button3.showstouchwhenhighlighted = no;     [button3 addtarget:self action:@selector(buttonclick:)       forcontrolevents:uicontroleventtouchupinside];         button3.tag = 2;     [foodcell.contentview addsubview:button3];` 

now when button pressed cell using superviews , bit of math using tags figure out index in array need at. seems work need display checkmark on buttons have been pressed, kind of shopping list once item pressed ticked off , un-ticked. struggling find efficient way of acheiving of this.... have thoughts, appreciate ive been stuck while now.

many thanks

jules

can't instance of clicked button sender of action buttonclick: , add view resembling check-mark on button?


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -