Core Data - Fetched Property with bitmasks and abstract entities

258 Views Asked by At

Core Data Editor displaying situation

(Data models renamed to preserve anonymity. :D )

So, I have a situation where on a Thing, whose configuration is defined by its own special object, though that object can be one of 2 class types.

I would like to be able to do Fetch Requests on this model by asking if the Thing's Configuration is of a certain known subclass, and if so, does it have a few specific flags set in its bitmask. If this is true, I define this as being "not special". Therefore, if it also has the other type of subclass as it's Configuration, it is also "not special".

My questions are these:

  • Have I got my syntax right? (In my app I get faults)
  • Why does it want to return an NSArray? (I thought its traversing a to-one relationship on a single object. How would I therefore interpret this NSArray?)

I should add that I only know Core Data via MagicalRecord more or less. And I use mogenerator too.

0

There are 0 best solutions below