Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Littleodie914

macrumors 68000
Original poster
Jun 9, 2004
1,813
8
Rochester, NY
I'm using an NSSplitView in my application. Dragging and dropping controls into the two Custom Views provided causes an enormous amount of clutter and confusion when trying to resize the app, select specific objects, etc.

Is there a way in Interface Builder to have an object "reference" another object? For example, in the screenshot below, is there a way to tell Interface Builder that the Custom View in the left pane of the split view "is" the Left View I created? Can I assign them the same "Object ID"? It would be very convenient to focus on one pane of the split view at a time. Especially if you were to embed an NSSplitView in another NSSplitView. Certainly Apple can't expect us to contain all that in a single window!

This kind of clutter has been alleviated in the iPhone XIB files, as you can reference one XIB from another, but I haven't found an efficient way of completing this same task using IB to develop a Mac OS X application interface. :confused:
 

Attachments

  • Screen shot 2010-10-18 at 6.47.25 PM.png
    Screen shot 2010-10-18 at 6.47.25 PM.png
    290.5 KB · Views: 338
I think the only way to do this is with a little code, but IMO it's worth it: create a subclass of NSSplitView and add two NSView outlets. In the subclass' awakeFromNib, set the two views as the split view's subviews. Finally, in IB set the class name on the NSSplitView and connect the outlets to your custom views.
 
I think the only way to do this is with a little code, but IMO it's worth it: create a subclass of NSSplitView and add two NSView outlets. In the subclass' awakeFromNib, set the two views as the split view's subviews. Finally, in IB set the class name on the NSSplitView and connect the outlets to your custom views.
That's what I was afraid of, but I suppose it's not too terrible a solution. Well worth avoiding all the confusion. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.