Search code examples
objective-cios5uibuttonhide

uibutton hide and dropdown text


I have a signup button that switches screens for a signup form. I'd like for it to hide the button and drop down text boxes beneath when the button is tapped (instead of switching screens). Is this possible? Currently I have in my .h file...

@property (nonatomic, strong) IBOutlet UIButton *emailSignUp;
- (IBAction)hideButton:(id)sender;

and in the .m file my method is as follows

- (IBAction)hideButton:(id)sender {
[self.emailSignUp setHidden:YES];

}

However it seems to be crashing whenever I try to test. Any advice? I thank you guys in advance. I know there is a long way to go, but I feel this is my first step.


Solution

  • It sounds like you haven't connected the button you created in the Interface Builder portion of Xcode to the emailSignUp IBOutlet. You can do this by going to the Interface Builder, selecting File's Owner and then the Connection Navigator (in the right side panel, designated by the arrow icon in the tab bar). Then, drag from the Outlet to the button.