xcode - Detect a button from a custom cell and change the properties -


i have table there button custom cell. when press button, calls method detects button using code:

nsindexpath *indexpath = [nsindexpath indexpathforrow: [[[notification userinfo] valueforkey:@"row"] intvalue] insection: 0]; placeroomcustomcell *cell = (placeroomcustomcell*)[self tableview:self.tableview cellforrowatindexpath:indexpath]; (uiview *view in  cell.contentview.subviews){     if (view.tag == 1) {         (uiview *subview in  view.subviews){             if ([subview iskindofclass:[uibutton class]]){                   [(uibutton *)subview setimage:[uiimage imagenamed:@"placeroomtablecelllikebuttonredicon.png"] forstate:uicontrolstatenormal];                   [(uibutton *)subview setimage:[uiimage imagenamed:@"placeroomtablecelllikebuttonredicon.png"] forstate:uicontrolstatehighlighted];                   [(uibutton *)subview setimage:[uiimage imagenamed:@"placeroomtablecelllikebuttonredicon.png"] forstate:uicontrolstatedisabled];                    nslog(@"tag %i",subview.tag); //correct              }          }       } } 

the tag correct, image not changed.

i can't use id sender of button directly, or rather, prefer not use it.

the code seems correct

thank you!

normally, when ui object sends action controller, method passed sender, can not use this?

e.g. definition of method code above sits might like:

-(void)buttonpressed:(id)sender; 

where sender should button. although have sneaky suspicion we're missing other vital information in question, since you're using nsnotifications...


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -