Restoring View Controllers

Since the two view controllers have a restoration class, the restoration class will be asked to create new instances of their respective view controller. In BNRItemsViewController.h, have the view controller conform to the UIViewControllerRestoration protocol.

@​i​n​t​e​r​f​a​c​e​ ​B​N​R​I​t​e​m​s​V​i​e​w​C​o​n​t​r​o​l​l​e​r​ ​:​ ​U​I​T​a​b​l​e​V​i​e​w​C​o​n​t​r​o​l​l​e​r​ ​<​U​I​V​i​e​w​C​o​n​t​r​o​l​l​e​r​R​e​s​t​o​r​a​t​i​o​n​>​

@​e​n​d​

Then, in BNRItemsViewController.m, implement the one required method for this protocol, which will return a new view controller instance.

+​ ​(​U​I​V​i​e​w​C​o​n​t​r​o​l​l​e​r​ ​*​)​v​i​e​w​C​o​n​t​r​o​l​l​e​r​W​i​t​h​R​e​s​t​o​r​a​t​i​o​n​I​d​e​n​t​i​f​i​e​r​P​a​t​h​:​(​N​S​A​r​r​a​y​ ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.