On Feb 11, 2011, at 9:19 AM, Michael Crawford wrote:

> Thank you both for your suggestions.

You're welcome.  I'm glad I could help.

> I ended up going with Ken's idea regarding the synthetic property.  It was 
> added to a NSManagedObject derived class so I couldn't use it during the 
> fetch request without actually adding an attribute but I did use it to sort 
> the resulting array.  The synthetic property computes an priority index when 
> invoked.  It performs very well.

By the way, I neglected to mention that you should also implement 
+keyPathsForValuesAffecting<Key> for your synthetic property returning the set 
of key paths which affect its value (e.g. the genre property).  That's 
necessary for the synthetic property to be properly KVO-compliant.  This should 
be standard operating procedure for all synthetic/derived properties.

Cheers,
Ken

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to