Box object in IB?

havic

Windsurfer Nerd
In Interface Builder, I tried putting one of those boxes around a bunch of text labels and fields. The problem is that once a box is there, if I click on a label or text field inside the box, it selects the box. There is now no way for me to edit the attributes of the text fields and labels, as I cannot select them anymore.

What am I doing wrong?
 
havic said:
What am I doing wrong?
I think you are adding the box over the top of your other controls. You need to add the box first then add the controls to the inside of the box, so the box contains all the controls. If you think about it, it makes sense!
 
Ah yes, that fixed it.

The book I'm studying didn't make it clear at all that I had to even put the box in there, until it asked me to put in code to change the boxs title. Well, it works now :)
 
Select your controls, and go Layout > Make subviews of > Box. After that, you can double-click the box to edit its contents.
 
Well, selecting controls and making them subviews of the box isnt much use if I can't select the controls :p

I think Apple doing it that way is sort of silly though, it means that if decide later on to make an interface change and enclose say 10 controls in a box, then you have to cut the controls out of the window, drop the box on and put the controls back. Of course, this will break the connections.
 
You don't need to drag a box out from the control palette. Just select your controls, since they are NOT covered by a box, and go Layout > Make Subviews of > Box. This creates a NEW box, enclosing your controls in it, and KEEPING the connections. I suggest you try it.
 
Back
Top