Version: 1.5

Posted: 2008-03-05

Build Requirements: Xcode 3.0

Runtime Requirements: Mac OS X 10.5

View Source Code:

Download Sample (“PhotoSearch.zip”, 4.49M)
Download Sample (“PhotoSearch.dmg”, 4.83M)



Description

This sample application uses Spotlight to perform a search for images on your computer. The NSPredicateEditor (introduced in Leopard) is used to create a custom search query. The results are displayed in a custom NSTextFieldCell subclass that  automatically adds tracking areas to perform automatic rollover highlighting effects inside the cells. A custom DateCell class is implemented that demonstrates how to properly truncate dates based on the cell size. The NSPathControl (introduced in Leopard) is used to display selected paths. Custom views inside a menu are shown with sample code. Finally, threadsafe background thumbnail image processing is demonstrated by the data model.

Document Revision History

Date Notes
2008-03-05Removed pre-Leopard workarounds for highlighting cells. Also replaced deprecated -selectRows:byExtendingSelection: and -columnsInRect: with their modern NSIndexSet replacements.
2007-11-05Updated the row height of the NSPredicateEditor
2007-05-31Verified for Leopard.
2006-08-08N/A
2006-08-01Demonstrates advanced controls and cells. Custom drawing, hit testing, tracking, editing, expansion tooltips, tracking areas.

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.