Join Todd Perkins for an in-depth discussion in this video Connecting MainViewController to the data model, part of Building a Note-Taking App for iOS 8.
- With our data model set up and…our user interface prepared,…we're going to go to MasterViewController.swift…and implement our data model into the existing code…by replacing all the code that…references the objects array.…So here I'm going to delete this line of code…and delete just a little bit of the white space…and then what we're going to do is look at…all of the errors that were created.…If you look at the top of my screen you'll see that I…have five errors in my code.…
As I scroll down you'll see those errors.…These errors are occurring because I deleted…the objects array so the great thing about this is…it tells us all of the points at which we…need to replace that reference to a reference to…our allNotes array in Note.swift.…So back to MasterViewController.…So I'm going to change this code on line 35…and insert new objects to…allNotes.insert.…
Now that method name is different than insert…object at Index because the data type is different.…Remember objects was an NSMutable array…whereas allNotes is swift array of Notes.…
Each of these courses helps you build a complete mobile app from scratch; this installment uses the iOS SDK and Xcode to get the job done. Author Todd Perkins shows you how to create an Xcode project, lay out apps visually, connect UI elements to code, and save data to persistent storage. Start here with iOS 8, and compare your results with the Android and Windows Phone courses to learn about the differences and similarities of these mobile platforms.
- Previewing the note-taking app's features
- Creating the Xcode project
- Using local data storage
- Creating a data class
- Saving data to a file or user defaults
- Understanding screens and storyboards
- Controlling transitions between views
- Connecting the controller to the data
- Creating, editing, and deleting notes