28 Sep 2010, 17:46

Stephen Watson (30 posts)

In the Popover chapter, there is a subheading Displaying a Popover where it states that we can set the popoverContentsSize property so that the popover is the same size as the view we’ve configured in the CargoColorChooser nib. Well …

I have checked and double checked the code and my View in IB for CargoColorChooser is just large enough to enclose all the 6 colour buttons but every time I run the app the size of my popover takes up almost the entire screen (according to the debugger it’s actually 748x712). My ‘from’ arrow is fine and the popover works correctly.

It says in Apple’s documentation:

“When changing the value of this property, the width value you specify must be at least 320 points and no more than 600 points. There are no restrictions on the height value.”

My view size is 199 wide so it breaks this, but then so is the size of the view in the downloaded Prag Prog sample code. However, your official code works just fine.

Any ideas what silly mistake I’m making here?

Thanks in advance.

01 Oct 2010, 20:37

Gordon Apple (28 posts)

I just enclose everything in a containing view, the size I want. I give it a tag of 1000 so I can find it when I launch the popover and set the size accordingly.

21 May 2011, 17:16

tgma (2 posts)

Make sure your CargoViewController nib has the runtime view controller attribute “Resize View From NIB” unchecked.

21 May 2011, 17:27

tgma (2 posts)

…the CargoColorChooser object in the CargoViewController nib to be exact…:-)

  You must be logged in to comment