I have a CoreData entity (waypoint) with a foreign key to another entity (track). When the foreign key is set, or if it is not set, this if statement works fine:
if ([wp track]) {
thirdLabel.text = [NSString stringWithFormat:@"Part of Track: %@", [[wp track] title]];
}
However, if the track that the waypoint is keyed to has been deleted, then [wp track] still evaluates to true, and the program crashes when I set the label text.
So, how do I properly check for this "has been deleted" null value in CoreData?