Filling In the Table

Let’s think about how we’re going to go from this to a table of real tweets. Since the table can demand the contents of any row at any time, we’ll want to have a data structure representing all the tweets that we want to show in the table. This doesn’t have to be anything fancy; an array will do just fine.

But an array of what? Well, one approach would be to just create a class including the parts of a tweet we care about—its text, the screen name of the person who sent it, etc.—and then have an array of those objects. We haven’t had to create a new class of our own yet, so let’s do that.

Creating a ParsedTweet Class

To create a new class in our project, we use FileNew File (N), which causes a sheet to slide out showing ...

Get iOS 8 SDK Development, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.