I have several IBOutlet and use them with IBOutletCollection :
@interface IBOutletCollectionViewController : UIViewController {
IBOutletCollection (UILabel) NSArray *multipleLabels;
}
@property (nonatomic , retain) IBOutletCollection (UILabel) NSArray *multipleLabels;
@end
but when I want use the UILable properties the compiler gives this error :
request for member ‘textColor’ in
something not a structure or union
I think it’s because of NSArray ! is there any solution for that ?
You can use Key-Value Coding to set the property on each label instance in the array:
“IBOutletCollection(UILabel)” can be omitted in the iVar declaration as long as it’s used in the property declaration.
Another option is to call “makeObjectsPerformSelector:” on the NSArray instance: