objective c - Pass button Selected state to another view Controller -


i have 2 view controllers. 1st controller have 1 button. use

 button.selected = yes; 

i'm using if statement custom functions if button selected state.

  -(ibaction)play:(id)sender;     {      if (button.selected)         {             custom code         }      } 

when use button in same view controller play button works. want move button view controller. it's not working.

question how pass button select value other view controller?

i don't know you're trying achieve. dragged button 1 interface builder window , wonder why button doesn't trigger 'play:' in vc 2 or want let second view controller know state of button subview of view controller one?

1) if dragged button 1 ib window check connections again. that's usual problem here.

2) if wanna let vc 2 know state of button that's currenty on vc 1 one way adding bool vc 2 represents button's state. whenever button get's triggered responsible updating bool.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -