How do I define to an UIButton...

Discussion in 'iOS Programming' started by guydor, Feb 22, 2010.

  1. guydor macrumors member

    Mar 10, 2009
    To display an UIImageView that when I tap it (UIButton) it will display or disappear the UIImageView
  2. ethical macrumors 68000

    Dec 22, 2007
    Read the Apple documentation, or google for any of the hundreds of tutorials out there that will cover this most basic of tasks.

    At least try, then if you get any errors, that's when you ask for help in clearing them up.
  3. HarryWorksInc macrumors regular

    Feb 21, 2010

    As lukenn said, you need to at least try next time but for now, in the .h declare a button and an action. Link the action to the button. Link the IBOutlet of the button to the button. In the .m put your action but this time instead of:
    do this
    -(IBAction)Action {

    and in the Action put this:

    if (Button.hidden == YES) {
    Button.hidden = NO;
    } else {
    Button.hidden = YES;

    I think that this is simple to do and that if you don't know C or if i'm correct any other Programming language you start of simpler.

Share This Page