Custom Views

How would you use a custom view’s content, of a custom view you placed straight into IB, and put what is in that custom view into a scroll view or the view of a window?

What I have tried is this but it doesn’t seem to work, but may give an idea of what I am asking:

property: customview : missing value
property scrollview : missing value
property thewindow : missing value

on applicationWillFinishLaunching_(aNotification)
	thewindow's makeKeyAndOrderFront_(aNotification)

	scrollview's setContentView_(customview)
	thewindow's setContentView_(customview)
end applicationWillFinishLaunching_

I haven’t done it with a scroll view, but I’ve used setContentView_ with a window like that. I’m not sure what’s going to happen when you try to put the same view in two places, though.

Keep in mind that the view will be squished into the size of the container. For a window, the best thing to do is to setContentView_ to an empty view, resize the window to the final view’s size by using frameRectForContentRect_ and setFrame_display_animate_, and then setContentView_ to the view you want.