Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode UIImageView won't link to the code

I have a problem:

I need to insert a UIImageView into my application that changes images each time. The code I have written is correct, but the UIImageView box I dragged on my view in storyboard won't link to the code. I drag the blue line on the codes but it just does not link.

@property (nonatomic, retain) IBOutlet UIImageView *image1

Can you help me????

like image 738
Alessandro Avatar asked Jun 27 '26 01:06

Alessandro


1 Answers

Two possible things:

  1. are you also adding it in your @Interface in the .h file? like below:

    @interface FirstViewController : UIViewController {
        IBOutlet UIImageView *image1;
    }
    
  2. Also, after you do this make sure you are linking your UIImage View to your files owner in the .xib file. control drag from "File's Owner" right into the image view.

I don't have a ton of iOS experience, but these are two pretty common problems.

like image 98
Fitz Avatar answered Jun 29 '26 11:06

Fitz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!