Key Concepts: Tableviews/Arrays

UUINavigationController is a very commonly used software design pattern. It is used by a multitude of iOS classes to provide user and data interaction. Delegates have both required and optional methods. Xcode will help you figure out which are required by giving you a warning if you are missing required delegate method bodies.

UITableView uses two different delegates, separating user interaction and data extraction. The two delegate protocols that UITableView uses are UITableViewDelegate and UITableViewDataSource. They are both properties of UITableView: delegate and dataSource respectively.

Code completion in Xcode is very helpful and by leading off a new delegate method implementation with '-< method name snippet >' you will see possible matches. Sometimes the list of possible matches is a bit overwhelming. If you happen to know the return value of the delegate method you want to implement: '-(UITableViewCell*)tableView...' this will significantly narrow down the choices to only those methods that have a return type of UITableViewCell*.

ReusableIdentifiers are used by UITableView to conserve memory and system processing. ReusableIdentifiers allow the UITableView to instantiate the minimum number of UITableViewCells necessary to render the displayed data. In most cases, less than 15 UITableViewCells are instantiated and re-used no matter how many elements will ultimately be displayed.

Switch statements are very handy when evaluating the absolute value of a variable of type int or NSInteger. Relative comparisons cannot be evaluated in a switch case (i.e. if the variable is greater than or equal to 5). When that is the logic requirement, use an if statement.

NSArrays are immutable data structures; their contents cannot be altered in any way. Consider these types of data types read-only. There are some cool ways to instantiate NSArrays with class convenience methods and literals.