0

I have a UIViewController (JDTHViewController) with a UIView (JDTHMainMenu) In the view controller are two buttons that each, once clicked, move to two other separate view controllers. In the UIView are two other buttons (options and stats) that, once clicked, create subviews on top of the view, minus a few pixels from each side, and therefore hide the two buttons so you can interact with the subviews. Now when I run the simulator all my buttons are in the right positions but once one of the UIViews buttons are clicked they disappear and the segue buttons (ViewController switch buttons) are on top of my subviews. I need these to disappear once 'options' or 'stats' is clicked. Is there a way to do this? I hope that made sense if not i'll post more info or code. Thanks!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
JonHerbert
  • 647
  • 1
  • 8
  • 23

3 Answers3

0

yourButton.hidden=1; or [yourButton setHidden:1];
Instead of 1 you can use YES.
Do you mean this?

nicael
  • 18,550
  • 13
  • 57
  • 90
  • 2
    For ObjectiveC `BOOL` type argument you should pass `YES` or `NO`. Avoid passing `int` values. – Amar Apr 08 '14 at 14:09
0

Create a delegate callback from the UIView to the viewController and hide it. If you want to hide two buttons at the same time sending a notification would be easier.

rustylepord
  • 5,681
  • 6
  • 36
  • 49
-1

Do you mean

buttonName.hidden = YES;

As you are in another class, hide it using NSNotificationCenter

Here is good example

Community
  • 1
  • 1
Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276