0

Im working on an iphone project with storyboards in Xcode, and I have a tableview that lists cells loaded from an array it owns. Through push segues I load 2 other views for adding an item to the table, and then I use a unwind segue to go back to the table.

In the segue method for the tableview, I use "reloadData" to load the added cell. But when I do so, the table scroll boundaries are off, as if no cell was added. Though when I go back one step in the push-"hierarchy" and back in again to the tableView, the boundaries are working fine. So, I guess I have to do some more updating in the segue method other than just calling "reloadData"?

(by "boundries are off" I mean that the tableview scrolling starts to bounce at the same scroll position as it did before any added cells. I guess its best explained in the gif found by the link below)

Sorry for such a trivial question, but I'm having a hard time finding whats wrong. Thanks!

(made a nice gif of the problem, but dont have reputation enough to post images... here's the link: http://i251.photobucket.com/albums/gg304/creutzell/Comp-1.gif)

lxl
  • 31
  • 5

2 Answers2

0

Maybe you did the frame setting of tableview in viewDidLoad.Make it into the viewWillAppear or viewDidAppear method

It surely is the problem in frame as the height is increased somehow

Lithu T.V
  • 19,955
  • 12
  • 56
  • 101
  • I actually don't set the frame setting at all (the naive side of me didn't think this was necessary), just standard tableviewcontroller dragged in from the UIKit list, the wierd thing is that it works when I "push" back one step and enter the tableview again! – lxl Apr 03 '13 at 16:42
  • Whats confusing me is what the storyboards are doing for me automatically when I push the view from "above". Is the frame height automatically changed on this segue, and do I need to manually change the frame (do what the storyboard automatically is doing in the push segue) in the unwind segue method? – lxl Apr 03 '13 at 16:55
0

Ok so here is how I "solved" it:

I switched the tableViewController to a viewController with a tableView, and It then works as it is supposed to (the height of the table is automatically updating without me having to write any code for it other than calling reloadData).

It seems like this is a bug for the tableViewController combined with unwind segues.

lxl
  • 31
  • 5