I have an issue with a View Controller which is loaded from a NIB. In this NIB I have 2 views, a landscape and portrait. When willAnimateForRotation occurs I i set
// willAnimateForRotation..
if (isLandscape) {
self.view = self.viewLandscape;
}
else {
self.view = self.portraitView;
}
in the beginning I set both tables to editing mode:
// viewDidLoad
[self.tableViewPortrait setEditing:YES animated:NO];
[self.tableViewLandscape setEditing:YES animated:NO]; // *
// *
I am pretty sure this line is causing cellForRow to be called on tableViewLandscape at this point, instead of when i set self.tableView = self.tableViewLandscape
It only happens the first time, if I perform 2 orientation changes it will load the items into the tableView correctly.
i dont want to do a [self.tableView reloadData] in orientation change.. that would be redundant.
can anyone see a more graceful way for me to fix this?
Ok, best I could come up with is:
its a cheap hack but can’t think of a more correct solution.