uiviewcontroller - Changing UILabel with a button -


so, have popover can activated 4 viewcontrollers. inside popover, click on button , button changes 1 uilabel in viewcontroller activated popover.

but, problem is: depending on viewcontroller actives popover, text different.

my question: how can set 1 if clause know viewcontroller activated popover?

here code changes uilabel, have implement if clause:

- (void) escolheu1:(id)sender {     [delegate menucontroller:self           haspressedsomething:             [nsstring stringwithformat:@"they panels composed odd numbers of layers, crossed each other in order obtain more strength."]]; } 

i guess gotta use iskindofclass method, maybe not, don't know.

can guys help, please?

thank you!

well, have "sender" parameter being sent "escolheu1:" method (and while we're on subject, should declare "(ibaction)" , not "(void)").

and sender parameter, can determine button (in each of 4 view controllers) sent message.

one way via setting "tag" value buttons in each of view controllers in storyboard, , can determine button called method this:

- (ibaction) escolheu1:(id)sender {    uibutton * thebutton = (uibutton *) sender;    nslog( @"which button has tag? --> %d", thebutton.tag );    ....    ....    .... } 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -