I would like to save an array of view controllers in NSUserDefaults, but I am not sure how:
[[NSUserDefaults standardUserDefaults] setObject:tabBarController.viewControllers forKey:@"tabOrder"];
When I read the above line, my tabBarController.viewControllers is blank.
The view controllers in this array are not serializable, and thus won’t be saved to
NSUserDefaults.From the NSUserDefaults reference:
You should re-initialize your view controllers on the next load. You can however serialize their data to
NSUserDefaultsto some custom fields.