Open Menu
Close Menu
Apple
Shopping Bag
Apple
Mac
iPad
iPhone
Watch
TV
Music
Support
Search apple.com
Shopping Bag
Lists
Open Menu
Close Menu
Terms and Conditions
Lists hosted on this site
Email the Postmaster
Tips for posting to public mailing lists
Spotlight query and NSInMemoryStoreType
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Spotlight query and NSInMemoryStoreType
Subject
:
Spotlight query and NSInMemoryStoreType
From: Benjamin Dunton <
email@hidden
>
Date: Wed, 28 Sep 2005 17:34:51 -0400
All,
I am having a problem with updates to Core Recipe like Smart Folders. Here is the setup:
I have a Master/Detail design. The master has 2 "Smart Folders" that are assigned to the same NSInMemoryStoreType. One is populated by a spotlight query of the files found in the iTunes Music directory, the other is only added to for local files to the application. I have to problems:
When I add a file to my "Library" it is also added to my "iTunes Library" (the Smart Folder in my application, not the actual iTunes library. However, the same does not happen if a file is added to the "iTunes library", e.g. when the spotlight query finishes and several hundred tracks are added to the "iTunes Library" smart folder, those tracks do not get added to the "Library" smart folder. Since both of these are in memory stores, this is not that big of an issue..BUT...
My second problem is a serious performance issue. If the user has both iTunes and my application open at the same time, and adds/edits/ updates a file in iTunes, the spotlight query kicks off again. However, it does not send just the modified files, it sends all the files again.So the processing bogs down the system. To optimize this I implemented the two tips in Core Recipes Smart Folders refresh: method. I directly removed the files from the NSSet, and the added and updated objects were put into one array and filtered using the predicate. If the arrayis not empty, I add all the objects to the Smart Folders set.
This fixed my performance issue; however now all the items in the "iTunes Library" now appear in the main library. A "near term solution" is to stop the spotlight query after it finishes the first time. This would leave the "iTunes Library" potentially out of sync; however, it would most likely be minimal. Ultimately, I would like the Library and iTunes Library to update independently, and be efficient..
Any suggestions?
Ben Dunton _______________________________________________
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
Prev by Date:
How to bind contextual menu to selection?
Next by Date:
Re: 10.3.9 cross development SDK not working?
Previous by thread:
How to bind contextual menu to selection?
Next by thread:
NSData archival of a directory
Index(es):
Date
Thread