views:

24

answers:

1

I started out with some items as NSWindows but my GUI is evolving and these elements would be better suited as NSViews. Is there a way to convert an NSWindow NIB into an NSView NIB?

+1  A: 

There's no such thing as an “NSWindow nib” or an “NSView nib”. There's only one kind of nib (not counting xibs separately); the only difference is what it contains.

A window has a content view, which, in windows created in IB, is almost always an NSView. So, if you want the nib to hold the view directly, without the window, simply switch the nib window to list view, expand the window, copy its content view, deselect the window, and paste the view, then delete the window.

Note that this will break any connections from other objects' outlets to the view or its subviews.

Peter Hosey