How can I connect an IBOutlet from my code to two different objects in interface builder

StackOverflow https://stackoverflow.com/questions/3611636

  •  26-09-2019
  •  | 
  •  

Question

I'm using the iPhone SDK 4.0 and I want to connect IBOutlet UIImageView *block; to more than one image on the view in interface builder. However, whenever I try and link the second image, the first image becomes disconnected. How can I connect two images to the same IBOutlet code?

Was it helpful?

Solution

IBOutlet variables have a one-to-one relationship with objects in interface builder. Therefore you will have to have another variable.

OTHER TIPS

put them in two different xib file then can access them using a single iboutlet using the code [[NSBundle mainBundle] loadNibNamed:@"tests" owner:self options:nil];

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top