Declare a property to hold your imageView's and then hook them up in interface builder like normal
@property (nonatomic, strong) IBOutletCollection(UIImageView) NSArray *imageViews;
it's just a normal NSArray
but when the nib is loaded it will be populated with your imageView's
Update
In the header file for you view controller which has the multiple imageView's on you need to add the property above - it may look something like this:
@interface MyViewController : UIViewController
@property (nonatomic, strong) IBOutletCollection(UIImageView) NSArray *imageViews;
// other properties
@end
Now in the interface builder you connect all the imageView's to this one property.
Now I just work with the imageViews
collection
for (UIImageView *imageView in self.imageViews) {
imageView.image = someImage;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…