Ok, working though the Core Data Utility Tutorial, and there's a bit of code here that works, but I don't understand it, so I was hoping someone could explain it to me.
What I see is that it's creating an instance of NSManagedObjectModel and assigning it a nil value. Then it's asking if that instance is not equal to nil. How can it ever NOT be nil, if the line directly before the if statement assigns it a nil value? This is what I don't understand. Anyone got any clue?
Code:
static NSManagedObjectModel *mom = nil;
if (mom != nil) {
return mom;
}
What I see is that it's creating an instance of NSManagedObjectModel and assigning it a nil value. Then it's asking if that instance is not equal to nil. How can it ever NOT be nil, if the line directly before the if statement assigns it a nil value? This is what I don't understand. Anyone got any clue?