开发者

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

开发者 https://www.devze.com 2023-01-13 17:35 出处:网络
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, w开发者_JAVA百科henever I try and link the second ima

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, w开发者_JAVA百科henever I try and link the second image, the first image becomes disconnected. How can I connect two images to the same IBOutlet code?


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


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];

0

精彩评论

暂无评论...
验证码 换一张
取 消