Join John Nastos for an in-depth discussion in this video Populating the UI with stored information, part of Building an iOS Address Book App.
- [Voiceover] We now have the ability…to create the person object with the information…the user entered in the fields,…but that object doesn't get saved anywhere right now,…or displayed anywhere,…so let's add some ways to do those things.…In my appDelegate file,…I'm going to create an array to store the person objects,…and I'll call that array, contactsArray.…It'll be an array of class Person,…and I'll initialize that array right here.…Then in my addViewController, I'll want to add the person…that was created to that array.…
In the addButtonPressed method,…once the person is created,…first I need a reference to the appDelegate,…so I'll write…let appDelegate equals UIApplication….sharedApplication.Delegate…as AppDelegate.…Then I'll call appDelegate.contactsArray.append,…and I'll add that new person object.…
Now that person object is stored in that array.…I'm going to end up needing a reference to the appDelegate…again later, so I'm going to copy this line…before I move on, so that I can just paste it in later.…Now I need a way to access that data from the UI.…
Build the project step-by-step and then use what you've learned to explore your own app ideas.
- Creating the project in Xcode
- Using Auto Layout to design the UI
- Attaching the interface to the code
- Creating the data model, including a Person class
- Adding stored data to the UI
- Displaying a contact's address with MapKit
- Linking contact info to other iOS apps
- Adding persistence
- Working with table views
- Writing tests
- Preparing to publish the app in the App Store