Chauffage iPad version
I started working on the iPad-version. It turns out to be much more work than I initially thought it would be. My detail view is quite complicated and requires a lot of dedicated TableCellViews. If I want to support landscape, I even need to double those. As many CellViews have TextFields in them, the delegate TextField method obtained a rather complex switch-statement (as some other methods as well).
Some issues that I encountered:
- Toolbar not visible - for the detail view, I used a standard UITableViewController object on the storyboard. Unfortunately I was not able to add toolbars to the corresponding scene. I could have put a UINavagationController before the UITableViewController, however that resulted in other errors, which seemed difficult to solve. So I reverted to a standard UIViewController and added all the necessary objects. That needed some more wiring to do, but all works;
- Initialisation in portrait orientation - I have a problem with initialisation, when the iPad is in portrait orientation. The necessary data is then not set up as should. Problem is that the master splitView is not presented on screen and thus the initialisation is not done. It might be necessary to do this in awakeFromNib;
- Enabling a button based on selected row - I will enable a button based on whether a row is selected. But where should I disable it?
- Next/Previous - I had the idea of adding a next/previous button on the detail splitView. However what next and previous is, is only known by the masterSplitView. This is however off-screen. I opted for a protocol, so that the current view is updated with a new client. I disable the next/previous button, when there is no longer something available, which turned out to be a bit fiddly to take care of the edges. I decided to change my initial implementation. Things are now a lot simpler: the less code, the more stable;
- reloadData does not display - I have the situation where I can change the entire contents of a tableView which is on display. So no pass through ViewWillAppear or ViewDidAppear. So I should force an update through [tableView reloadData]. Well that method is indeed called and it calls in turn cellForRowAtIndexPath: with the correct data, but still nothing happens. Not figures this one out yet;