1

Im transferring my project from xibs to using a storyboard. I just added the Settings page, which i made from a UIViewController to a UITableViewController. The table view cells are added using the static method in the storyboard. The table has 5 sections, with 12 cells. I have no other code doing anything to the TableView, and in the storyboard scrolling is on. When running on my iPhone 5 the view wont scroll, all the cells are there, and i can pull and see the cells hidden, but when letting go it scrolls to the top still. Like when pulling up on a page in a UIWebView basically. Xcode gives no warnings, or errors, how can i fix this?

Edit: I found the 2 lines of code causing it not to scroll, But i still don't know how to fix it. The code gets the custom TextFieldTableCell and sets the text for it, because I'm using a storyboard, It doesn't call CellForRow,

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    TextFieldTableCell *cell = (TextFieldTableCell *)[SettingsTable cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
    cell.textField.text = [[NSUserDefaults standardUserDefaults] objectForKey:@"Homepage"];
}

The TableView is only disabled from scrolling if the 2 lines under [super viewWillAppear:animated]; are called in the method - (void)viewWillAppear:(BOOL)animated, but if i call the lines in - (void)viewDidAppear:(BOOL)animated it will still scroll, except it takes a second to show that text, which isn't something i want, should be auto-loaded when user see's the TableViewController, are there any workarounds? Any other methods called like viewWillLoad but shouldn't disable the table?

Maximilian Litteral
  • 3,059
  • 2
  • 31
  • 41
  • possible duplicate of [UITableView doesn't scroll](http://stackoverflow.com/questions/13733354/uitableview-doesnt-scroll/13733476) – Gabriele Petronella Dec 10 '12 at 00:43
  • If you can see all the cells, then it shouldn't scroll (except for the bounce), it doesn't need to. The content size of the scroll view will only as big as the table view (plus a little more for the bounce, I guess). – rdelmar Dec 10 '12 at 06:13
  • Oh, no like i see some of them, and then i can pull down but its not really scrolling, its bouncing up and its like im pulling, but the cells are there, it just wont scroll to them fully. It will just bounce up when i let go. – Maximilian Litteral Dec 10 '12 at 06:16
  • have this code in viewDidLoad instead. – Mattias Farnemyhr Dec 11 '12 at 09:26
  • If i put in viewdidload, it will scroll but nothing actually happens, most likely because since its using a storyboard, the table isnt there yet or something. – Maximilian Litteral Dec 12 '12 at 01:02
  • can you replace [SettingsTable ... by [self.tableView ...? – MUH Mobile Inc. Dec 13 '12 at 17:38

0 Answers0