Sample Code
This page lists new and recently changed sample code. Most sample code has a revision history, which details additions and changes since the previous version. Look for "Revision History" at the bottom of the sample code page.

Items are listed in reverse chronological order by publication date. To see the list sorted by the type of revision, click Sort by Revision Type. Items published for the first time (First Version) will be at the top of the list, followed by items with new or changed content (Content Update), followed by items with small fixes, such as typos and format errors, but no significant content changes (Minor Change).

New and updated sample code is announced in the bi-weekly Apple Developer Connection News, available as an option to ADC members. See the Membership Overview page for details on joining.
Document Revision Descriptions
On Off
Sort by
Date
Sorted by
Title
Sort by
Revision Type
Sort by
Topic
2008-03-17 AbstractTree (HTML) (DMG) (ZIP)
Fixed a typo in the definition of a leaf node.
Minor Change Data Management, User Experience
2008-05-15 AlbumToSlideshow (HTML) (DMG) (ZIP)
Adds the resizing of images to fit in the generated XML sequence and allows for multiple albums with the same name.
Content Update Objective-C Language
2008-03-10 CarbonCocoaTempConverter (HTML) (DMG) (ZIP)
Updated to produce a universal binary. Added code and comments for clarification.
Content Update Events & Other Input, User Experience
2008-04-24 CIColorTracking (HTML) (DMG) (ZIP)
More comments. Fixed some errors in the project.
Content Update Graphics & Imaging
2008-06-04 DerivedProperty (HTML) (DMG) (ZIP)
Illustrates use of Core Data derived properties to make searching against string data more efficient.
First Version Data Management, Performance, Text & Fonts
2007-12-20 DictionaryController (HTML) (DMG) (ZIP)
"DictionaryController" is a Cocoa application that demonstrates various ways in how to use the NSDictionaryController class.
First Version Data Management, User Experience
2008-02-25 FSMegaInfo (HTML) (DMG) (ZIP)
Prints information about various file system objects; helpful when debugging VFS plug-ins.
First Version File Management
2007-12-19 GeekGameBoard (HTML) (DMG) (ZIP)
Shows how to use Core Animation for the user interface of a board or card game.
First Version Games, Graphics & Imaging
2008-01-18 IconCollection (HTML) (DMG) (ZIP)
Demonstrates how to use NSCollectionView along with NSWorkspace and named images to determine its content.
First Version User Experience
2008-06-02 Mountains (HTML) (DMG) (ZIP)
Demonstrates localization and internationalization techniques and APIs
First Version Internationalization
2008-06-02 MyMovieFilter (HTML) (DMG) (ZIP)
Updated to use a Core Animation layer-backed view.
Content Update QuickTime
2008-03-17 NumberInput_IMKit_Sample (HTML) (DMG) (ZIP)
Illustrates an input method that uses the Mac OS X 10.5 InputMethodKit framework.
First Version Events & Other Input, Internationalization
2008-02-06 OpenGL Filter Basics Cocoa (HTML) (DMG) (ZIP)
How to use Objective-C and MVC design patterns in installing and utilizing filters in an OpenGL rendering pipeline
First Version Games, Graphics & Imaging
2008-03-05 PhotoSearch (HTML) (DMG) (ZIP)
Removed pre-Leopard workarounds for highlighting cells. Also replaced deprecated -selectRows:byExtendingSelection: and -columnsInRect: with their modern NSIndexSet replacements.
Content Update Data Management, Events & Other Input, User Experience
2008-01-21 QTAudioContextInsert (HTML) (DMG) (ZIP)
Editorial
Minor Change Audio, QuickTime
2008-02-22 QTCompressionOptionsWindow (HTML) (DMG) (ZIP)
Demonstrates how easy it is to manage QTCompressionOptions instances with a user interface.
First Version QuickTime
2008-04-24 QTCoreVideo101 (HTML) (DMG) (ZIP)
added automatic texture coordinate generation for teapot video
Content Update QuickTime
2008-06-06 QTCoreVideo102 (HTML) (DMG) (ZIP)
An application demonstrating the use of QTKit, CoreVdeo, and OpenGL.
First Version Graphics & Imaging, QuickTime
2008-06-06 QTCoreVideo103 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using OpenGL texture range and the Core Video pixel buffer pipeline.
First Version Graphics & Imaging, QuickTime
2008-06-06 QTCoreVideo201 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using OpenGL FBO and the Core Video texture pipeline.
First Version Graphics & Imaging, QuickTime
2008-06-06 QTCoreVideo202 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using OpenGL PBO and the Core Video pixel buffer pipeline.
First Version Graphics & Imaging, QuickTime
2008-06-06 QTCoreVideo301 (HTML) (DMG) (ZIP)
Demonstrates adding of effects & filters to QuickTime Movies in realtime using GLSL shaders and the Core Video texture pipeline.
First Version Graphics & Imaging, QuickTime
2008-02-28 SBSendEmail (HTML) (DMG) (ZIP)
Using the Scripting Bridge to tell Mail.app to send an email message with an optional attachment.
First Version Interapplication Communication, Internet & Web, Scripting & Automation
2007-12-04 SBSetFinderComment (HTML) (DMG) (ZIP)
Set/Get Finder Comments using Scripting Bridge
First Version Scripting & Automation
2007-12-13 ScriptingBridgeiCal (HTML) (DMG) (ZIP)
Adding/updating events in iCal using Scripting Bridge.
First Version Interapplication Communication, Scripting & Automation
2008-06-06 SpotlightFortunes (HTML) (DMG) (ZIP)
Demonstrates 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.
First Version File Management, User Experience
2008-06-05 URL CacheInfo (HTML) (DMG) (ZIP)
Demonstrates resource caching behavior using the Cocoa URL loading system.
First Version Networking, Performance
2008-05-09 WhackedTV (HTML) (DMG) (ZIP)
Fixed two bugs: (1) "Select Output Format" in the audio dialog failed with error -206 if the source audio were set to 20 or 24 bits on an Intel Mac. The source format is 24-bits aligned low in 32-bits. WhackedTV was setting this as the default output format. But QuickTime movies can only contain packed samples. Added a utility function to conform the output format for movie-safety. (2) Began preferring the kQTSGAudioPropertyID_CodecSpecificSettingsArray property to the kQTSGAudioPropertyID_MagicCookie property. See QuickTimeComponents.h for an explanation of the differences between these properties, and why CodecSpecificSettingsArray should always be preferred over MagicCookie.
Content Update Audio, QuickTime
2008-01-04 With and Without Bindings (HTML) (DMG) (ZIP)
Updated to use Objective-C 2.0.
Content Update Data Management, Design Guidelines