This particular topic has always made me wonder is there a more efficient way to do it…
If I have for example 24 IBOutlets in my view controller and I want to add them to an array in viewDidLoad for easy referencing at at later point in a loop is there a better way to add to the array apart from:
[myArray addObject: iboutlet0];
[myArray addObject: iboutlet1];
[myArray addObject: iboutlet2];
[myArray addObject: iboutlet3];
[myArray addObject: iboutlet4];
...
...
...
is there a way to add the IBOutlets to the myArray in a loop block?
You could add them in Interface Builder to an
IBOutletCollection. Don’t know how or if it is sorted so if that is important, you could set the tag value of each outlet and sort by that.