2

I've placed some images in my interface with Interface Builder and set them to be hidden on startup... Now I want to change the hidden attribute to FALSE, when I press a button, but I haven't tried accessing interface built images in my code before (not even sure if it is possible)...

Any help?

NoobiOS
  • 25
  • 1
  • 5
  • 1
    I'm sorry if i have completely misunderstood, but why not just use an IBOutlet to the UIImageView, or set its tag to like 10 and then call [(UIImageView *)[self.view viewWithTag:10] setHidden:NO]; – Chance Hudson Jun 15 '11 at 16:24

1 Answers1

2

Just create some IBOutlets in your code, connect them in Interface Builder and then use them in your code.

e.g.

//in your header:

IBOutlet UIImageView *image;

// in your code (e.g. in the IBAction for the button):
- (IBAction)showImageNowFoo:(id)sender {
    [image setHidden:NO];
}

btw: FALSE is false. NO is Objective-C (although FALSE works..)

tnull
  • 728
  • 5
  • 17
  • 2
    PS: if this really was your question you should consider reading a good cocoa / cocoa-touch book or tutorial. – tnull Jun 15 '11 at 16:31