O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Challenge: Make a Data Source

Make a to-do list application. The user will type a task into the text field. When the user clicks the Add button, you will add the string to an array and the new task will appear at the end of the list (Figure 7.15).

Figure 7.15  Objects in to-do list app

Objects in to-do list app

How will you get the table view to fetch updated information? You tell the table view to reload its data using the aptly-named method reloadData(). The table view will then reload all the cells that the user can see.

You get extra points for making the table view editable.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required