Jump To:
Each Sample Code project is buildable and executable source example of how to accomplish a task for a specific Apple technology. They show the correct sequence of calls and parameter data types to provide a generalized method for API use that developers can modify for their specific needs.

Document Descriptions
On Off
Display

Sort by
Title
Sorted by
Topic
Sort by
Date
WebKitDOMElementPlugIn (HTML) (DMG) (ZIP)
A Web Kit plug-in that modifies its own DOM element style
Cocoa 2006-08-04
WebKitPluginStarter (HTML) (DMG) (ZIP)
Shows how to make a minimal WebKit plug-in.
Cocoa 2007-06-06
WebKitPluginWithJavaScript (HTML) (DMG) (ZIP)
Shows how to call JavaScript from a WebKit plug-in and vice versa.
Cocoa 2007-06-06
WebKitPluginWithSimpleGUI (HTML) (DMG) (ZIP)
A WebKit plug-in with an Interface Builder GUI
Cocoa 2007-06-04
WhackedTV (HTML) (DMG) (ZIP)
A Cocoa version of the venerable HackTV sample code, demonstrating usage of the Sequence Grabber API's
Cocoa 2008-05-09
With and Without Bindings (HTML) (DMG) (ZIP)
Illustrates the adoption of Cocoa Bindings and refactoring using a subclass of NSArrayController.
Cocoa 2008-01-04
Worm (HTML) (DMG) (ZIP)
NSView performance demonstration. Uses a periodic timer to get best performance with Coalesced Update feature.
Cocoa 2005-06-01
WritableFileDemo (HTML) (DMG) (ZIP)
Shows how to create an empty, writable file associated with a QTMovie object.
Cocoa 2006-08-01
BSDLLCTest (HTML) (DMG) (ZIP)
Program sample demonstrates how to send and receive raw LLC Ethernet packets.
Core Foundation 2003-06-12
CFFTPSample (HTML) (DMG) (ZIP)
A simple example showing how to use CFFTPStream to download and upload files.
Core Foundation 2006-10-13
CFHostSample (HTML) (DMG) (ZIP)
Uses the CFHost API to do DNS hostname lookups and to determine host reachability.
Core Foundation 2004-04-20
CFLocalServer (HTML) (DMG) (ZIP)
Uses UNIX domain sockets to communicate between client and server programs on the same machine.
Core Foundation 2005-07-26
CFNetworkHTTPDownload (HTML) (DMG) (ZIP)
Demonstrates how to download a URL using CFNetworking.
Core Foundation 2006-01-18
CFPreferences (HTML) (DMG) (ZIP)
Shows how to use the CFPreferences APIs to access user preferences.
Core Foundation 2003-01-14
CFPrefsDumper (HTML) (DMG) (ZIP)
Shows how to use the CFPreferences APIs to access information about the current user preferences.
Core Foundation 2003-01-14
CFPrefTopScores (HTML) (DMG) (ZIP)
How to access globally shared (writable) user preferences without requiring authentication.
Core Foundation 2006-10-09
CFProxySupportTool (HTML) (DMG) (ZIP)
Shows how to use the CFProxySupport APIs to decide whether a network connection should pass through a proxy.
Core Foundation 2007-10-29
CheckExecutableArchitecture (HTML) (DMG) (ZIP)
Determine whether a particular Mach-O executable contains a version suitable for executing on a given processor architecture.
Core Foundation 2006-02-07
CoreTextArc (HTML) (DMG) (ZIP)
Illustrates the use of fonts, lines, and runs in a CoreText text drawing Carbon application.
Core Foundation 2007-06-04
CoreTextTest (HTML) (DMG) (ZIP)
Shows how to handle the CoreText objects to display text.
Core Foundation 2006-12-19
DisplayURL (HTML) (DMG) (ZIP)
Parses a passed in path URL into its various components displaying server information.
Core Foundation 2005-10-04
DNSServiceMetaQuery (HTML) (DMG) (ZIP)
Shows how to discover Bonjour service types being advertised on the local network.
Core Foundation 2005-06-01
EventMonitorTest (HTML) (DMG) (ZIP)
Receive notification of all keyboard, mouse, and tablet events passed to other processes.
Core Foundation 2005-11-09
FileNotification (HTML) (DMG) (ZIP)
kqueue file notification introduced in 10.3. Notification API to detect file system modifications.
Core Foundation 2005-10-27
filesystem_examples (HTML) (DMG) (ZIP)
Collection of command line tools illustrating filesystem features.
Core Foundation 2006-01-10
FSCopyObject (HTML) (DMG) (ZIP)
Copy engine for copying files and directories.
Core Foundation 2004-03-19
FSMegaInfo (HTML) (DMG) (ZIP)
Prints information about various file system objects; helpful when debugging VFS plug-ins.
Core Foundation 2008-02-25
IdentitySample (HTML) (DMG) (ZIP)
IdentitySample builds a utility which demonstrates how to use the CoreServices Identity API to manage system-wide identities
Core Foundation 2006-07-27
ImageClient (HTML) (DMG) (ZIP)
Demonstrates how to use CFNetwork for synchronous and asynchronous operations, network diagnostics, proxy navigation, and authentication.
Core Foundation 2005-06-01
InkSample (HTML) (DMG) (ZIP)
Demonstrates some usage scenarios for the Ink.Framework APIs.
Core Foundation 2003-10-27
LocalServer (HTML) (DMG) (ZIP)
Deprecated - Sample demonstrates how a Classic process can communicate with a Mac OS X process using IP networking protocols.
Core Foundation 2003-01-30
ManagedObjectDataFormatter (HTML) (DMG) (ZIP)
A Data Formatter for Xcode 2.0 and 2.1 that displays NSManagedObject * variables.
Core Foundation 2005-06-01
MapLargeFile (HTML) (DMG) (ZIP)
Shows a technique for mapping files greater than 4GB into memory for faster access.
Core Foundation 2003-11-19
MoreIsBetter (HTML) (DMG) (ZIP)
Library providing indispensable wrapers and workarounds for many areas of Mac OS programming.
Core Foundation 2003-10-27
NamingTableAccess (HTML) (DMG) (ZIP)
Digs out the contents of the NamingTable in a TrueType 'sfnt'.
Core Foundation 2003-01-14
PasteboardPeeker (HTML) (DMG) (ZIP)
Using pasteboards for Copy and Paste, Drag and Drop, service support and filter services.
Core Foundation 2005-08-10
RecentItems (HTML) (DMG) (ZIP)
Implements "Recent items" menu(s)
Core Foundation 2006-10-09
SimpleDial (HTML) (DMG) (ZIP)
Demonstrates management of dialup connections, such as PPP, using System Configuration framework network connection API.
Core Foundation 2005-07-26
SimpleReach (HTML) (DMG) (ZIP)
Demonstrates network host reachability testing using the System Configuration framework asynchronous network reachability API.
Core Foundation 2005-07-26
Spotlight (HTML) (DMG) (ZIP)
Sample code that shows how to write Spotlight Importers.
Core Foundation 2005-06-01
Watcher (HTML) (DMG) (ZIP)
Uses FSEvents to monitor a directory hierarchy to keep track of its total size
Core Foundation 2006-08-04
BootstrapDump (HTML) (DMG) (ZIP)
Print Mach bootstrap namespace information.
Darwin 2008-06-18
CFLocalServer (HTML) (DMG) (ZIP)
Uses UNIX domain sockets to communicate between client and server programs on the same machine.
Darwin 2005-07-26
CFProxySupportTool (HTML) (DMG) (ZIP)
Shows how to use the CFProxySupport APIs to decide whether a network connection should pass through a proxy.
Darwin 2007-10-29
CheckExecutableArchitecture (HTML) (DMG) (ZIP)
Determine whether a particular Mach-O executable contains a version suitable for executing on a given processor architecture.
Darwin 2006-02-07
CryptNoMore (HTML) (DMG) (ZIP)
Shows how to authenticate a user using Open Directory (Directory Services).
Darwin 2008-03-17
CryptoSample (HTML) (DMG) (ZIP)
Contains sample code showing symmetric encryption and message digest calculation.
Darwin 2003-02-06
dist_fft (HTML) (DMG) (ZIP)
Gigaelement FFTs on Apple G5 clusters
Darwin 2004-08-23
DNSServiceMetaQuery (HTML) (DMG) (ZIP)
Shows how to discover Bonjour service types being advertised on the local network.
Darwin 2005-06-01
EmptyFS (HTML) (DMG) (ZIP)
A very simple VFS plug-in that mounts a volume that is completely empty.
Darwin 2006-11-09
FileNotification (HTML) (DMG) (ZIP)
kqueue file notification introduced in 10.3. Notification API to detect file system modifications.
Darwin 2005-10-27
filesystem_examples (HTML) (DMG) (ZIP)
Collection of command line tools illustrating filesystem features.
Darwin 2006-01-10
FSMegaInfo (HTML) (DMG) (ZIP)
Prints information about various file system objects; helpful when debugging VFS plug-ins.
Darwin 2008-02-25
GetMACAddressSample (HTML) (DMG) (ZIP)
Demonstrates how to retrieve the MAC address for each Ethernet interface from the Mac OS X I/O Registry.
Darwin 2003-01-14
GetPrimaryMACAddress (HTML) (DMG) (ZIP)
Demonstrates retrieving the MAC address of the built-in Ethernet controller. Useful for uniquely identifying a Macintosh system.
Darwin 2005-10-27
IOKitWithLibrary (HTML) (DMG) (ZIP)
Shows how an I/O Kit driver can link with a C library from a separate kernel extension.
Darwin 2003-08-27
IOPrintSuperClasses (HTML) (DMG) (ZIP)
Given the name of a class, this tool will print all of the super-classes of that class.
Darwin 2005-08-17
KauthORama (HTML) (DMG) (ZIP)
Prints each Kauth request, illustrating how Kauth interacts with high-level operations, like copying files.
Darwin 2007-04-30
MachPortDump (HTML) (DMG) (ZIP)
Dumps out the Mach port name space of a process; useful when debugging port right leaks.
Darwin 2005-08-10
MapLargeFile (HTML) (DMG) (ZIP)
Shows a technique for mapping files greater than 4GB into memory for faster access.
Darwin 2003-11-19
MemoryBasedBundle (HTML) (DMG) (ZIP)
Shows how to execute Mach-O code from memory, much like GetMemFragment in CFM.
Darwin 2005-08-10
MFSLives (HTML) (DMG) (ZIP)
Sample VFS plug-in for the Macintosh File System (MFS) volume format, as used on 400KB floppies.
Darwin 2006-11-09
MoreIsBetter (HTML) (DMG) (ZIP)
Library providing indispensable wrapers and workarounds for many areas of Mac OS programming.
Darwin 2003-10-27
MoreSCF (HTML) (DMG) (ZIP)
High-level wrapper around System Configuration framework, making common operations easy.
Darwin 2007-06-07
Moriarity (HTML) (DMG) (ZIP)
Implementing a Cocoa GUI that wraps command-line functionality, calling a UNIX task and presenting the results in a GUI.
Darwin 2003-01-14
NetworkAuthentication (HTML) (DMG) (ZIP)
Demonstrates authentication with Open Directory APIs and GSSAPI
Darwin 2005-06-01
NotifyTool (HTML) (DMG) (ZIP)
Shows how to use the BSD notify API.
Darwin 2007-09-25
PIDFromBSDProcessName (HTML) (DMG) (ZIP)
Provides a simple API to do process PID lookup based on BSD process name.
Darwin 2003-02-13
QISA (HTML) (DMG) (ZIP)
Demonstrates the basics of writing an Internet setup assistant for traditional Mac OS and Mac OS X.
Darwin 2003-05-15
SampleD (HTML) (DMG) (ZIP)
Demonstrates use of launchd and Apple System Logger.
Darwin 2005-10-27
SampleFilterScheme (HTML) (DMG) (ZIP)
Demonstrates a simple filter scheme which passes all operations through to its provider unchanged.
Darwin 2006-01-03
SampleUSBAudioPlugin (HTML) (DMG) (ZIP)
USB audio plugin that performs a lowpass filtering operation on audio streamed through an audio USB Device.
Darwin 2005-03-07
SCSIHBAEmulator (HTML) (DMG) (ZIP)
Demonstration of how to implement a virtual parallel tasking SCSI host bus adapter (HBA)
Darwin 2007-02-20
SimpleDataQueue (HTML) (DMG) (ZIP)
Implements an IODataQueue inside an I/O Kit KEXT which passes events and data to user space.
Darwin 2003-01-14
SimpleDial (HTML) (DMG) (ZIP)
Demonstrates management of dialup connections, such as PPP, using System Configuration framework network connection API.
Darwin 2005-07-26
SimplePing (HTML) (DMG) (ZIP)
Sample provides simple API to programatically ping a remote host without admin privileges
Darwin 2003-10-27
SimpleReach (HTML) (DMG) (ZIP)
Demonstrates network host reachability testing using the System Configuration framework asynchronous network reachability API.
Darwin 2005-07-26
SimpleUserClient (HTML) (DMG) (ZIP)
Shows how to create a user client for an I/O Kit kernel driver.
Darwin 2008-08-27
SocketCancel (HTML) (DMG) (ZIP)
Shows how to safely cancel threads that are blocked within BSD sockets calls.
Darwin 2005-08-10
SSLSample (HTML) (DMG) (ZIP)
Contains examples showing how to use SecureTransport.
Darwin 2003-01-14
TimerEventSample (HTML) (DMG) (ZIP)
Shows how to set up and use an IOTimerEventSource in a kext.
Darwin 2003-01-14
UTXplorer (HTML) (DMG) (ZIP)
Uses the <utmpx.h> API to display current login sessions and login history.
Darwin 2008-03-19
VendorSpecificType00 (HTML) (DMG) (ZIP)
Demonstrates how to access vendor-specific storage device functionality using a simple interface from user space code.
Darwin 2006-10-02
VolumeToBSDNode (HTML) (DMG) (ZIP)
Shows how to iterate across all mounted volumes and retrieve their BSD node names.
Darwin 2006-10-16
Watcher (HTML) (DMG) (ZIP)
Uses FSEvents to monitor a directory hierarchy to keep track of its total size
Darwin 2006-08-04
GridCalendar (HTML) (DMG) (ZIP)
Demonstrates how to add a custom job submission UI to the GridSample project.
Enterprise IT 2005-06-01
MoreIsBetter (HTML) (DMG) (ZIP)
Library providing indispensable wrapers and workarounds for many areas of Mac OS programming.
Enterprise IT 2003-10-27
NetworkAuthentication (HTML) (DMG) (ZIP)
Demonstrates authentication with Open Directory APIs and GSSAPI
Enterprise IT 2005-06-01
WikiSampleThemeWithCSS (HTML) (DMG) (ZIP)
Demonstrates how to change the appearance of a wiki theme using CSS properties.
Enterprise IT 2008-06-02
WikiSampleThemeWithJavaScript (HTML) (DMG) (ZIP)
Demonstrates how to add a JavaScript functionality to a wiki theme.
Enterprise IT 2008-06-02
aglClipBufferRect (HTML) (DMG) (ZIP)
Shows the use of clip regions and buffer rects in AGL.
Games 2003-01-14
AGLSurfaceTexture (HTML) (DMG) (ZIP)
Example of render to texture/texture from surface using aglSurfaceTexture.
Games 2003-07-07
BlitVBL (HTML) (DMG) (ZIP)
Shows how to have Mac OS X try its best to sync to the VBL for you.
Games 2003-01-14
BoingX (HTML) (DMG) (ZIP)
Shows off using Quartz Extreme to provide borderless OpenGL content on the desktop.
Games 2007-11-06
CALayerEssentials (HTML) (DMG) (ZIP)
Demonstrates the basics of setting up various Core Animation layers
Games 2008-09-30
Carbon GLSnapshot (HTML) (DMG) (ZIP)
Demonstrates the use of OpenGL with Quicktime to capture OpenGL content.
Games 2003-07-07
CFPrefTopScores (HTML) (DMG) (ZIP)
How to access globally shared (writable) user preferences without requiring authentication.
Games 2006-10-09
CGGamma (HTML) (DMG) (ZIP)
Shows how to use CGDirectDisplay calls to manipulate display gamma tables.
Games 2003-01-14
CIColorTracking (HTML) (DMG) (ZIP)
An Objective-C applicaton that implements a GPU-based technique to find the location of a uniquely colored object in a scene
Games 2008-04-24
Cocoa OpenGL (HTML) (DMG) (ZIP)
Demonstrates using Cocoa with OpenGL, including window setup and event handling.
Games 2007-10-22