One of the basic ways to populate a table view with data is to use an array. Using an array, you can set the table view to adjust its row count based on the size of the array. In this movie, you will see how you can create an array and put its data inside a table view in Xcode 7 and the iOS 9 SDK. Table views can hold different data that can then be customized.
- [Voiceover] When you create your own applications,…you're not going to fill a table view with the same…data on every single column, or at least, you mostly won't…do that, so let's look at how to populate…our table view with data from an array for example.…I'm going to define an array way up here,…so I'll type let, we'll call this data…and that's going to be an array of strings,…and then I'll set it equal to an array.…Item one and then we'll just comma separate…these and change the values.…
Two, three, four, five,…and then I'll change the numbers right here,…and now instead of using that integer inside of table…view number of rows and section,…I can use data dot count.…If I add anything for example, if I click…back in here and after this final comma,…I add in item six,…and that'll adjust according to the count of…the data constant there.…Now how do we get that data inside…of the table view?…If you look at line 27, that's where we're placing…the data inside of the label in each…table view cell.…
What this method is called, we actually…
Interested in developing for Apple Watch or Apple TV? Get a sneak peek in Chapter 9. The course wraps up with a look at the submission process for the App Store.
- Installing Xcode and the iOS SDK
- Creating a simple iOS app
- Creating a basic interaction with a button
- Choosing an object as a first responder
- Creating a user interface with Interface Builder and Auto Layout
- Working with sliders and progress bars
- Creating views to show images and web pages
- Developing responsive layouts with size classes
- Understanding the iOS architecture
- Loading data in table views
- Transitioning between views
- Developing for the iPad, Apple Watch, and Apple TV
- Submitting apps to the App Store
Skill Level Beginner
1. Prepare to Develop an iOS App
2. Core Skills
3. Basic iOS UI
4. More UI Objects
5. Size Classes
6. iOS Application Architecture
7. Table Views
8. Multiple-View Applications
9. iPad, Watch, and Apple TV Development
10. Finish and Submit to the App Store
Next steps2m 10s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.