SUMMARY

In this chapter, you had a good look at the Table view and learned how to customize it to display items in various formats. You also learned how to implement search functionality in the Table view, which is an essential function in real-world applications. In addition, you learned how to move between View windows in a Navigation-based application.

EXERCISES

  1. Name the two protocols to which your View Controller must conform when using the Table view in your view. Briefly describe their uses.
  2. Which method should be implemented if you want to add an index to a Table view?
  3. Name the three disclosure and checkmark accessories that you can use. Which one handles user taps?

Answers to the exercises can be found in Appendix D.

image WHAT YOU LEARNED IN THIS CHAPTER

TOPIC KEY CONCEPTS
Adding items to a Table view Handle the various events in the UITableViewDataSource protocol.
Allowing users to select rows in a Table view Handle the various events in the UITableViewDelegate protocol.
Adding images to rows in a Table view Use the image property of the UITableViewCell class and set it to an instance of the UIImage class containing an image.
Using a property list with a Table view Use the following code snippet to locate the property list:
NSString *path = [[NSBundle mainBundle]
pathForResource:@“Movies”
ofType:@“plist”];
Then use a combination of NSDictionary and NSArray objects to retrieve the key/value pairs stored in the property list.
Grouping items in a Table view in sections Implement the following methods: numberOfSectionsInTab leView:tableView:numberOfRowsInSection:tableView:t itleForHeaderInSection:.
Adding an index to a Table view Implement the sectionIndexTitlesForTableView: method.
Adding disclosure and checkmark images to a row in a Table view Set the accessoryType property of an UITableViewCell object to one of the following:
* UITableViewCellAccessoryDetailDisclosureButton
* UITableViewCellAccessoryCheckmark
* UITableViewCellAccessoryDisclosureIndicator.
Implementing a search in a Table view Use the Search Bar view and handle the various events in the UISearchBarDelegate protocol.
Navigating to another View window Use the pushViewController: method of the Navigation Controller.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.164.120