Join Simon Allardice for an in-depth discussion in this video Responding to validation issues, part of Core Data for iOS and OS X.
Let's get a little more involved with validating our data.…I'm going to jump into the data model file here.…Now, we've seen already that when we're working with entities, and the attributes of those…entities, that we can do things like provide a default value for them.…If we're working with numbers, we can provide a minimum and maximum value.…If we're working with strings, we can have minimum and maximum length, and even provide…a regular expression.…So, for example, if I wanted to say that all new authors should have a name that was at…least three characters, I'd select that attribute, and say this had to be a minimum length of…3, maybe I wanted a maximum length of 100. That will do.…
And save that data model file.…The question is when are these rules applied, when is this validated, and also, what happens…if I need something a bit more detailed than this?…Let's go ahead and run the application. I'll run the application. I create a new author.…Well, I'm going to create an author called Bo, and Bo should actually violate those validation…
- Understanding Core Data and object persistence frameworks
- Creating a Core Data project
- Exploring data modeling
- Creating entities, attributes, and relationships
- Creating managed objects
- Fetching in Core Data
- Implementing undo and redo support
- Creating a Core Data Cocoa app without code
- Responding to validation issues
- Converting store types
- Preloading default data
Skill Level Intermediate
Q: In the CoursesViewController.m file, I receive a message that the method dismissModalViewControllerAnimated is no longer supported by Apple. Is there a newer method to use?
A: You may have received the warning that a call to the dismissModalViewControllerAnimated: method is now deprecated.
This is a recently deprecated method, so the code _will_ continue to work using that call, but to remove the warning, change the code from:
to the current recommended version:
[self dismissViewControllerAnimated:YES completion:nil];
It should take care of that message.
1. Getting Started
2. Modeling in Core Data
3. Saving in Core Data
Creating managed objects12m 46s
4. Fetching in Core Data
Using predicates9m 32s
5. Putting It Together: iOS
6. Putting It Together: Cocoa
7. Store Types and Model Changes
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.