Smart Lists (smart folders, smart groups,...) with Core Data
Smart Lists (smart folders, smart groups,...) with Core Data
- Subject: Smart Lists (smart folders, smart groups,...) with Core Data
- From: zeno <email@hidden>
- Date: Tue, 15 Nov 2005 15:30:16 +0100
Apparently Fetched Properties are the simplest way to do smart lists
(à la iTunes or Mail.app) in a Core Data application. But there're
basically two problems when using Fetched Properties in this scenario:
1) no true "Live Update" feature (FP are not dynamic and don't update
when the destination is updated)
2) no true "Edit Smart List" feature (search terms content can be
edited, but not the criteria structure)
I have a working sample application and I managed to "fix" the two
problems with the following "workarounds":
1) programmatically call
refreshObject:(selectedSmartGroupObject)mergeChanges:(YES) when some
changes occur in the destination or when the smart group is selected
(this causes the fetch request associated with the fetched property to
be re-executed).
(Note: this is not actually a "workaround", it's proper and documented
code, but I still call it "workaround" because in the modern era of
bindings and C.D. where everything is dynamic, I feel a bit "grandpa"
having to manually refresh the source...but that's another story)
2) "fake" the Edit behaviour by deleting and recreating a new smart list
My question is:
Am I doing something I shouldn't? Could I do it better? Is there a
more appropriate way of doing this?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden