Dragging elements into a tab view question?

Okay, this should be an easy one so don’t every shout out the answer at once. :wink:

My preference window is beginning to have enough options now to warrent a tab view to keep thing orginized and keep window size to a minimum.

So what I figured I would do in IB is grab the bottom corner of the window and stretch it out temporarily to give myself some manuvering space. Then I dragged in a tab view from the pallet. Set the number of tabs and named them.

Then I figured I could just drag all of the ellements that I already had in to their apropriate tab view.

then move the tab view back to upper left corner of window then resize the window getting rid of all that excess space again.

Doesn’t quite work that way it seems. When I drag an element from outside of the tab view and place it in the tabview then test interface the element doesn’t show up in any of the tab views. more like it’s still a child of the window and as such hidden behind the tabview rather than in it.

How do I drag elements that are children of the window into the tab view so that they are now children of the tabview?

Option drag kind of works but only by dragging a copy and being a copy does not already have a parent/child relationship with anything yet. Is there a way to do this with out making a copy of the element? a way of breaking that parent/child relationship for the drag?

You are better off disconnecting all existing objects, deleting them, and creating new ones in your tab view items. Copying objects and dragging them between views… in my experience… is not wise. You run the risk of corrupting your nib and crashing IB. If you want all of the current objects in one tab view item, you can select “Layout > Make subviews of > tab view”. This will add all the objects to one tab view item and will save you the trouble of re-creating all of your objects. Just delete the ones you don’t want and recreate them in other tab view items. Make sure to disconnect your objects before deleting them to avoid “phantom connections”, an annoying situation where IB keeps telling Xcode to add code blocks for connections to objects that don’t exist anymore.

ooh, Good thing I asked. Thanks for the tip. :slight_smile:

Aha! There’s a problem I’m having. At least now I know why it’s happening.