0

Hm. While writing subject, I've found that this is impossible (according to this thread).

My goal is pretty simple: I have popover and button inside it. I want to show something bigger than current size of popover on button touchedUpInside, so I need resize popover. But since I can't get the reference to the popover, I need to keep reference to popover's "super view controller". That's just ugly.

So now I'm looking for some more elegant solutions.

UPDATE: That's ugly because I've ended with that expression:

[(UIPopoverController*)[[(AppDelegate*)[[UIApplication sharedApplication] delegate] calendarViewController] 
                        performSelector: @selector(popover)] 
 setPopoverContentSize:viewFrame.size animated: YES];

Just to resize simple popover :(

Community
  • 1
  • 1
folex
  • 5,122
  • 1
  • 28
  • 48
  • I guess the bigger content is in the super view controller, so you need a reference to it. Would be ok for you to pass a pointer to that content to the popOver? (you didn't say what type of content you want to show) – Teofilo Israel Vizcaino Rodrig Jul 23 '12 at 13:17
  • Hm. There is the "main" (I called it super) view controller, on which I have the button, which "shows" the popover. Inside popover, I have contentViewController, inside it I have another button, which "shows" something (e.g. UIView) that bigger than popover. From that UIView I need to resize popover. As I can see, this is impossible directly. So I need some workaround. – folex Jul 23 '12 at 13:22
  • Keeping a reference to a superview isn't a bad solution. It actually makes sense to do. If you want something else you can just implement a delegate pattern. – Dustin Jul 23 '12 at 13:24
  • But if I have a link to one of my parents directly, dependency structure will no longer be tree (acyclic). That feels dirty for me. – folex Jul 23 '12 at 13:27

0 Answers0