I’ve been using IBOutletCollections to apply the same behaviour to many objects which are hooked up in IB. This is a great time saver, but it still takes a long time to individually make the connection between each object in IB and the IBOutletCollection declared in my header file.
I’ve tried highlighting multiple interface objects in IB and dragging a connection to the IBOutletCollection, but even so it still only hooks them up one at a time. Is there a hidden way to connect many at once?
Thanks
Yeah… it is harder than you’d think. I recommend a radar at bugreporter.apple.com.
In my code, I’ve occasionally resorted to doing it in code like this. It saves a lot of time, hassle and bugs when I decide to change the font for all the buttons, or the background color or whatever. It gives the layout advantages of IB with the consistency of code.
I use a similar technique when I need to recursively collect all the controls (I use this for popover passthrough views, but it’s also useful for mass disable):