How can I connect an IBOutlet from my code to two different objects in interface builder
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?
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