Re: Best implementation for iTunes-like playlist structure?
Re: Best implementation for iTunes-like playlist structure?
- Subject: Re: Best implementation for iTunes-like playlist structure?
- From: Dave DeLong <email@hidden>
- Date: Sun, 08 Nov 2009 15:24:03 -0700
On Nov 8, 2009, at 2:31 PM, Jerry Krinock wrote:
On 2009 Nov 08, at 13:10, Dave DeLong wrote:
I've come across several guides and documentation that say the
fetched properties can be used to mimic smart playlists in iTunes,
but I've yet to see any example or explanation on how that can
actually be implemented.
I thought that's why they call it "Sample Code" :))
Indeed, and I have been unsuccessful in finding any that demonstrate
how to properly use fetched properties. Have you happened to come
across any?
I understand that a fetched property is basically a stored fetch
request, but from my experimentation, I've only seen how to define
the predicate at compile time (in the fetch request editor) and not
at runtime.
OK. I was thinking that this might work for your DefaultFolder "in
that their predicate is to show everything".
It seems like you're looking for a "user-defined relationship". I'm
not a database guru, but I seem to remember reading somewhere that
such a thing is a non-starter, particularly in Core Data. My
uneducated guess would be that, in this case, you need to remove
those relationships from your smart folders and do the filtering in
code.
Filtering in code is what I have been doing. In the model I linked to
in the OP, you'll see that the AbstractSmartFolder has a predicate
attribute. This was a string attribute that I would turn into a
predicate for use in a fetch request.
Looking through the documentation, I see that I can retrieve the
NSPropertyDescription for a fetched property and change its fetch
request. However, I would imagine that that would change the fetch
request in all instances of that entity (which I definitely do not
want). Is there really no other way to model smart playlists than to
store the predicate myself?
Dave
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden