Weirdness with contentSizeForViewInPopover

Discussion in 'iOS Programming' started by RonC, Apr 28, 2011.

  1. RonC macrumors regular

    Oct 18, 2007
    It's pretty likely that I don't understand what is going on with all of this, but it seems like this property of a view controller is only a recommendation.

    What is happening is that I have a set of hierarchical table view controllers that comprise my "Root View" for an Split-view iPad app. When I rotate to portrait mode, the root controller turns into a button that pops up with a UIPopoverConroller. The size of the view the first time this happens matches the setting of that view controller's contentSizeForViewInPopover value. The next table down needs a bigger view, so when I select that one the view grows. The problem occurs when I go back - the view doesn't shrink back to the size I want. As an example, it goes from (320.0, 88.0) to (320.0, 244.0) to (320.0, 300.0), but when I go back to the previous levels in the table it stays at the (320.0, 300.0) size.

    It's probably NOT the way contentSizeForViewInPopover works, rather it's probably the returned-to view controller not resetting it appropriately. Is there a message that's sent when a navigation controller pops a view controller off the stack that I should be responding to where I can reset this property?

Share This Page