Join Simon Allardice for an in-depth discussion in this video Working with relationships and delete rules, part of Core Data for iOS and OS X.
So currently, we have these two related sense of entities, we have authors, and their associated courses.…Question might be, what happens to a course object when I delete an author?…Well, the answer is it depends.…It all depends on how the relationship is defined in the data model.…So let me quit out of this and go into the data model.…All relationships of course, can be viewed from two perspectives.…I am going to open up my Utilities panel here, that we have right now Author going to Course…and Course going to Author.…
We can view this relationship from either perspective, but any relationship that's a…To-Many is the more interesting one here to use as a demonstration.…So let's take the relationship from Author to Course.…So a single author can be connecting to multiple courses, meaning can have a reference to multiple courses.…And those courses, in return, back the way will have a pointer to the author object.…And this is what we're interested in, here, is the delete rule being specified in our relationship.…
- 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.