Version: 1.0

Posted: 2008-06-06

Build Requirements: Xcode 3.1 and later, Mac OS X v10.5 and later

Runtime Requirements: Mac OS X v10.5 and later

View Source Code:

Download Sample (“SpotlightFortunes.zip”, 121.4K)
Download Sample (“SpotlightFortunes.dmg”, 136.8K)



Description

This sample was inspired by the classic Unix fortune program. Instead of reading entries from a monolithic .fortunes file, it uses Spotlight to find all files with the com.example.fortune-file UTI and displays them in a Cocoa table view. Since the focus of this sample is Spotlight's live query support, only minimal support for creating new fortune files is provided. Support for deleting, editing, etc. is left as an exercise for the reader.

Document Revision History

Date Notes
2008-06-06Demonstrates how to provision a Spotlight importer plug-in for a custom UTI, and how to use a NSMetadataQuery with bindings to display live query results in a table view.

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.