Join Todd Perkins for an in-depth discussion in this video Creating a data class, part of Building a Note-Taking App for iOS 7.
…Let's start writing the code for our application by creating our data model.…So I'm going to go to File, New, File.…Now for the template, I'm going to choose under iOS,…Cocoa Touch, Objective-C class, and then I'll click Next.…Now I'm going to name the class.…I'll call this Data.…The sub-class of NSObject, which is the root class for Objective C.…Now I'll click Create and Xcode creates the class files for me.…Note that I have two files, a .h,…or the header file, and .m, or implementation file.…
Let's go to Data.h, and I'm going to declare under the import…statement, a few keys that we're going to be using in our app.…I'll declare a key by typing #define.…And then the name of the key will be…a lowercase k, and then in camo case the name.…So the first key is going to be default text.…Set that equal to an at symbol and then in quotes, New Note.…And the reason why there's an at symbol is because this is what's called an NSString.…An NSString is an Objective-C object string.…
So it's not a primitive string.…It has methods that you can call on it.…
These courses take you through building 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, and compare and contrast your results with the other courses to learn about the differences and similarities of the 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
- Understanding screens and storyboards
- Creating and editing notes
- Controlling note display in a table view
- Deleting notes