In Interface Builder it is easy to connect an object from the NIB to an outlet in the File's Owner. However, my File's Owner is going to hold an array of sub-views, so I would like to instead add an object from the NIB to the File's Owner's array. Right now i'm just doing it by hand by checking the classes of each item from the top level objects array returned by loading the NIB, but this seems kind of awkward. Is there some way to do this directly in Interface Builder instead?
views:
25answers:
1
+2
A:
No, there isn't. Interface Builder doesn't have any concept of "add this to an array." It barely even has any concept of arrays aside from being "the thing that NSArrayController manages." If you're interested in this particular item, though, it would make more sense to give it an outlet than to iterate through the top level items. That seems needlessly fragile.
Chuck
2010-09-08 22:13:19
that sucks. so I guess i have to make a very small File's Owner class for this NIB and hold an array of those instead?
evilfred
2010-09-08 22:44:00
oh. I guess I can just have my Controller be the one that opens the NIB and owns the top level objects.
evilfred
2010-09-09 01:24:14