Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 7. Protocols > Important protocols

7.3. Important protocols

Now that you’ve seen all the guts of making and implementing a protocol, let’s look at the most popular protocols used in the development of an iPhone application. Apple relies on the protocol design method for many of its Cocoa classes. In this section we review four sets of protocols that you’ll likely use when developing your application. Let’s dive in.

7.3.1. <UITableViewDataSource>

The UITableViewDataSource protocol is a mandatory protocol to have implemented for any table view in your application. A table view is a visual element that’s meant to display some collection of information. Unlike any other user interface element in the iPhone UIKit, UITableView must be provided the data it’ll display. Without the data source protocol for a UITableView connected, a table view has no functionality. Let’s look at the required methods of this protocol and then look at some of the more popular optional methods.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint