I have tried to use fetched properties a couple of times, and although it seems to be the right approach, it never works.
In my latest attempt I added the fetched-property to my entity, selected the other entity in the model as the 'destination', and set the predicate to a condition that I know is valid.
Problem 1: When the NSManagedObject-class for the entity is generated it does not include anything for the fetched-property. After some searching I added the declaration for it in the .h file and the @dynamic statement for it in the .m file (yes, I know it's an NSArray * type).
Problem 2: Even after that, when I access this property in code I get an exception being thrown that states something to the effect that the fetch-request does not have an entity. I am assuming that the 'entity' would be the one specified as the 'destination' and it is, in fact, there.
So, I'd like someone to provide a concrete working example (iOS platform) where a fetched-property is defined in the model, declared in a NSManagedObject-derived class, and actually used from code.
At this point I am giving up on this time-waster and simply implementing the fetch-request code myself.
contents
XML) but the compiled model that's loaded into the application doesn't have target entities set. Frustrating! – Sixten Otto