Saving View States

There are a number of problems with the BNRItemsViewController:

  • The UITableView is not being restored to its existing scroll position, nor is the currently selected row (if the user has drilled down into an item) being restored.

  • The view controller does not save whether or not it is in editing mode, and so it is always restored with the default value (which is not in editing mode).

You will fix the second point soon very similarly to how you encoded information for the BNRDetailViewController, but before you do let’s take a look at the first point.

In addition to the view controllers having a restoration identifier, certain UIView subclasses can have a restoration identifier to save certain information ...

Get iOS Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.