RonLugge
RonLugge

Reputation: 5174

Given an NSManagedObject with optional to-one relationships, how do I check if they are empty or not?

This is a purely theoretical 'what if' question, so no pressure to rush to an answer. I'd prefer an answer that works in the context of a subclassed NSManagedObject, but I'll accept one that's based on the parent.

I know that if the relationship is to-many, I simply check and see the count of the NS(Ordered)Set, but when you have a to-one relationship, I'm not sure what I'd do.

Upvotes: 0

Views: 116

Answers (1)

borrrden
borrrden

Reputation: 33421

Check to see if it is nil or not.

Upvotes: 2

Related Questions