CS 185C/286 - Lecture 15

Cay S. Horstmann
Lecture 15 Quiz 1
What is true about iOS applications that use hierarchical tables?
- A button that identifies the preceding level is automatically supplied
- All parts of the hierarchy must be tables
- All tables at a given level must have the same structure
- All of the above
Lecture 15 Quiz 2
Which method is called to move from one hierarchy level to the next?
setViewController
pushViewController:
pushTableViewController:
pushViewController:animated:
Today's Lecture/Lab
- Navigation between tables
Navigation Between Tables
- Common "drill down" navigation pattern

UINavigationController
class manages a stack of table views
- No need for xib files
Reading Before Next Class

- Read chapter 9 in Beginning iOS 5 Development starting at "Second Subcontroller: The Checklist" and up to (but not including) "Third Subcontroller: Controls on Table Rows"
Lab

- Bring your laptop to the lab
- You will work with a buddy
- For this lab, match yourself up with a buddy who has a Mac
- I want you to submit your lab code to git. But don't use the git support in the IDE.
- Instead, tell XCode to put your (unmanaged) project into the
workspace/lab15
directory.
Table Navigation
- Follow the iPhone programming book Chapter 9, Navigation Controllers and Table Views
- What application type are you supposed to start with? (It's not a single view application.)
- Make
BIDFirstLevelViewController
. What is the superclass?
- Edit the app delegate as indicated. Look at the app delegate from the previous lab. Give a difference between the two.
- Make
BIDSecondLevelViewController
. What is the superclass?
- Why is everything removed from
BIDSecondLevelViewController.m
?
- Edit the .h and .m files of
BIDFirstLevelViewController
as indicated.
- Run the app. What happens?
- Make
BIDDisclosureButtonViewController
. What is the superclass?
- Make
BIDDisclosureDetailViewController
. What is the superclass?
- What is the difference between these two classes?
- Edit the .h and .m files of
BIDDisclosureDetailViewController
as indicated.
- Edit the .h and .m files of
BIDDisclosureButtonViewController
as indicated.
- Why did they do the steps in this order, instead of first completing
BIDDisclosureButtonViewController
before turning to BIDDisclosureDetailViewController
?
- Edit
BIDFirstLevelViewController
as indicated. Then run the app. What happens in the first table?
- What happens when you click the top row?
- What happens if you click the top row of the resulting table outside the button at the right?
- What happens if you click the button at the right?
- Which view makes that display?