Lecture 7: iPad

You know everything you need to do your assignment 3, so get to it (it is due next Monday).

Demo code (Psychologist) posted.

A second version (Psychologist with Dr Pill) is also posted and is described below.
YOU DO NOT NEED TO LOOK AT THIS VERSION TO DO YOUR HOMEWORK.

The Dr. Pill part was implemented using Replace (Detail) segues (as opposed to Push segues on the iPhone). No code change is required to do this (just create the Replace segues and give them the proper identifiers), EXCEPT for the fact that the split view bar button item must be transferred to the replacement view controller instance.

This transfer code can be found in prepareForSegue:sender:. Note that at the time prepareForSegue:sender: is happening, the destination view controller's outlets are not set up (specifically, the toolbar outlet), so a drop of code has to be added to HappinessViewController's viewDidLoad method to add the bar button item later (viewDidLoad is always called AFTER all outlets are set up--we'll be covering this View Controller Lifecycle method in lecture on Thursday).

Don't worry too much about the transfer code. For your homework, you will not be using Replace segues (just use target/action like Dr. Freud does).

The "Go to Dr. Pill Website" button was also added to the Dr. Pill version by simply creating a Popover segue to the DrPillWebsiteViewController scene. No code is necessary to make this work. You will also NOT need to use Popovers for your homework.

Downloads