Reputation: 121
I am trying to create a series of buttons. Some of which hide behind each other. For example I have a play and a pause button which are located in the same area. If the play button is pressed then it is then hidden and the pause button is shown. And vice versa. This works fine however I also have another button which shows an UI alert view with several options to choose from. None of these options should affect the play/pause buttons. Now whenever I press the pause/play buttons after I have pressed the UI Alert view button I get an NSInvalidArgumentException. I tried debugging it and worked out that this happens when I try to hide the play button (ie. playbutton.hide).
I have no idea whatsoever why this is happening but if anyone can give me any hints it would be much appreciated.
Upvotes: 0
Views: 111
Reputation: 10069
Instead of playbutton.hide, try using:
[playbutton setHidden:YES] or playButton.hidden = YES;
Upvotes: 1