0

I have a popover view which displays a table with two rows and the size of the popover is adjusted to show only those two rows. After i click any one of the rows i navigate forward to a new table view and the popover size increases accordingly. when i navigate back to the original table view having two rows the popover size increases by one row. It shows a three rows with a empty third row.

Please find my code below.

in initWithFrame for the table view i set the value for popover using contentsizeforviewinPopover. works fine when the view loads

After navigating back i am setting the same value(contentsizeforviewinPopover) inside viewwillAppear. But now the view has three rows.

Please suggest any solution.

Defendore
  • 649
  • 1
  • 8
  • 20
  • How do you calculate the size for the popOver? Have you tried changing the call to setContentsizeforviewinPopover in viewDidAppear? – Youssef Sep 21 '11 at 08:10
  • I calculate the size of the popover using height of row obtained from heightforrowatindexpath. If there are tiw rows i multplyit by 2. – Defendore Sep 21 '11 at 08:19
  • And what's the number of rows in the moment you calculate it? Can you post some code? – Youssef Sep 21 '11 at 08:22
  • [ender]I have fixed it and Thanks for you support. Please find my answer below.Also embedded the link from stackoverflow where i got the answer – Defendore Sep 22 '11 at 06:43

2 Answers2

1

I got it rectified. When the initial table view navigatesforward to the next table view i will set the value for contentsizeforviewinPopover to zero in viewdiddisappear. Again when in navigate back, the popover displays with proper size with the proper values present in viewwillappear.

Defendore
  • 649
  • 1
  • 8
  • 20
  • answer courtesy : http://stackoverflow.com/questions/2752394/popover-with-embedded-navigation-controller-doesnt-respect-size-on-back-nav – Defendore Sep 22 '11 at 06:42
0

I think there is some problem with you table datasource. As you said that popover size get changed and also there is an empty row in the table. I think your datasource get updated with blank data.

Please check your datasource in between your navigation.

Thanks

iphonedev23
  • 991
  • 2
  • 12
  • 24