I want to 开发者_运维问答create an iTunes style search function where a searchfield will look through the contents of a directory and display the results in an NSTableView
.
Is there a way to do this in Objective-C without having the contents of the directory added into the NSTableView
first?
You'll want to use Spotlight for searching meta-data like artists and other song information:
- Introduction to Spotlight
- Spotlight query sample code
SearchKit focus OTOH is on content search.
where is the "directory" located? are you talking about an actual directory on your local filesystem? I suggesting populating an array with the contents of a directory listing and then using on of the many howto's to get a search to populate a tableView.
http://cocoadev.com/index.pl?NSTableViewTutorial lesson 6
This is generally what SearchKit is for. It gives you access to the spotlight metadata, so that you can search for information like this very quickly.
精彩评论