This an assignment of Stanford iPhone programming course. The aim of this program is to browse the photos in tableViewControllers and display them in an ImageViewController.
The original code is written in iOS 7 environment, so it had two storyboards for iPhone and iPad. The former uses a tabViewController, and the latter uses a splitViewController.
Since iOS 8 allows us to use the splitViewController in both iPhone and iPad, so I just delete the iPhone storyboard, and use the iPad one as universal layout. My storyboard layout is like this: Oops, I can't post the layout image here, not enough reputation. click here to see the storyboard
I set the two segues which link two tableViewController with the lowest navigationViewController to "Show detail". And same as in Xcode template "Master-detail application", I set the splitViewController to delegate itself, and the leftBarButtonItem of my detailViewController(ImageViewController) to displayModeButtonItem in appDelegate.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem;
splitViewController.delegate = self;
return YES;
}
The problem is in iPhone portrait mode, the "Master" back button doesn't appear at the left-upper corner of the ImageViewController. In iPad mode, everything works fine.
I link my code here: code for this program. Hope someone could help. Thanks!