Jump To:
Leopard Sample Code
Cocoa is an object-oriented application environment designed for developing Mac OS X native applications. The Cocoa frameworks support rapid development and high productivity. Cocoa provides developers starting new Mac OS X projects the fastest way to full-featured implementations. Applications from other platforms can also be brought to Mac OS X quickly using Cocoa.

A guided introduction and learning path for developers new to Cocoa.   Essential information for developers using Objective-C.   Objective-C API references organized by framework.
Document Descriptions
On Off
Display

Sorted by
Title
Sort by
Topic
Sort by
Date
ABPresence (HTML) (DMG) (ZIP)
Displays a list of all the people in your Address Book and their iChat status.
Apple Applications, Interapplication Communication 2006-08-04
AbstractTree (HTML) (DMG) (ZIP)
Using NSTreeController with NSOutlineView, Bindings, and Core Data.
Data Management, User Experience 2008-03-17
AddressBookCocoa (HTML) (DMG) (ZIP)
Demonstrates some basic manipulations of the Mac OS X 10.2.x (and beyond) Address Book API.
Interapplication Communication 2003-01-14
AESendThreadSafe (HTML) (DMG) (ZIP)
Demonstrates how to send Apple events from threads other than the main thread.
Interapplication Communication 2007-03-09
AlbumToSlideshow (HTML) (DMG) (ZIP)
Demonstrates using CF and NSXML to create Final Cut Pro XML.
Objective-C Language 2008-05-15
AnimatedSlider (HTML) (DMG) (ZIP)
Demonstrates the use of an NSTimer to animate a control in Cocoa.
User Experience 2003-01-14
AttachAScript (HTML) (DMG) (ZIP)
Illustrates how you can extend any Cocoa application by adding some AppleScripts to it.
Interapplication Communication 2006-07-27
AudioBurn (HTML) (DMG) (ZIP)
Demonstrates how to create an object conforming to the DRTrackProduction protocol to create a RedBook audio CD.
File Management 2005-03-17
AudioDeviceNotify (HTML) (DMG) (ZIP)
Demonstrates how to enumerate audio devices attached to the system and how to handle device notifications
Audio 2006-04-21
AutoSample (HTML) (DMG) (ZIP)
How to run and display Automator workflows in your application.
Scripting & Automation 2007-05-23
AutoUpdater (HTML) (DMG) (ZIP)
This sample demonstrates Cocoa networking using the NSURL loading classes, NSURLConnection and NSURLDownload.
Networking 2005-06-01
BackgroundExporter (HTML) (DMG) (ZIP)
Demonstrates techniques which can be used to export QuickTime movies in a separate export process.
QuickTime 2005-07-22
BasicCocoaAnimations (HTML) (DMG) (ZIP)
"BasicCocoaAnimations" demonstrates the use of the animator proxy to easily animate Cocoa views and windows.
Graphics & Imaging, User Experience 2007-06-11
BindingsJoystick (HTML) (DMG) (ZIP)
Illustrates a bindings-enabled subclass of NSView.
Data Management, Design Guidelines, Events & Other Input 2005-06-01
BoingX (HTML) (DMG) (ZIP)
Shows off using Quartz Extreme to provide borderless OpenGL content on the desktop.
Games, Graphics & Imaging 2007-11-06
Bound Button (HTML) (DMG) (ZIP)
Illustrates using Cocoa bindings to bind a button's target and action parameters.
Data Management 2007-06-08
BundleLoader (HTML) (DMG) (ZIP)
Demonstrates how to load multiple Cocoa bundles or NSBundles (also known as plug-ins) into the main NSApplication.
Design Guidelines, Resource Management, Runtime Architecture, User Experience 2007-09-21
ButtonMadness (HTML) (DMG) (ZIP)
Demonstrates how to use the various types of buttons using a nib file or programatically.
User Experience 2007-10-30
CALayerEssentials (HTML) (DMG) (ZIP)
Demonstrates the basics of setting up various Core Animation layers
Graphics & Imaging 2008-09-30
CallJS (HTML) (DMG) (ZIP)
Illustrates how to call JavaScripts on a web page in a WebView from Objective-C and vice versa
Internet & Web 2007-03-09
CallMachOFramework (HTML) (DMG) (ZIP)
Shows two ways of calling a Mach-O framework from a CFM application on Mac OS X.
Runtime Architecture 2003-07-17
CarbonCocoa_PictureCursor (HTML) (DMG) (ZIP)
Demonstrates how to use NSCursor from a Carbon based application.
User Experience 2007-01-12
CarbonCocoaCoreImageTab (HTML) (DMG) (ZIP)
Carbon-based application creates a Cocoa-based web window which used CoreImage filters to transition between tabbed WebViews
Graphics & Imaging, Internet & Web 2006-07-25
CarbonCocoaTempConverter (HTML) (DMG) (ZIP)
Demonstrates how to integrate Carbon and Cocoa user interfaces in the same Cocoa application.
Events & Other Input, User Experience 2008-03-10
CarbonInCocoa (HTML) (DMG) (ZIP)
How to use Carbon GUI code in a Cocoa application.
Events & Other Input, User Experience 2003-03-26
CarbonQuartzComposer_TV (HTML) (DMG) (ZIP)
Demonstrates how to integrate Cocoa based QuartzComposer window into a Carbon based application
Graphics & Imaging, Porting 2006-10-02
CFM_MachO_CFM (HTML) (DMG) (ZIP)
CFM application calls Mach-O routine, passing in a fixed up CFM function pointer as a callback parameter.
Runtime Architecture 2003-07-17
CGDrawPicture (HTML) (DMG) (ZIP)
Deprecated - Shows how to use the QDPictDrawToCGContext API.
Graphics & Imaging 2003-01-14
CheckExecutableArchitecture (HTML) (DMG) (ZIP)
Determine whether a particular Mach-O executable contains a version suitable for executing on a given processor architecture.
Runtime Architecture 2006-02-07
CIAnnotation (HTML) (DMG) (ZIP)
Image annotation application using Core Image Filters. Demonstrates creation and usage of Image Units.
Graphics & Imaging 2005-08-01
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
Graphics & Imaging 2008-04-24
Clock Control (HTML) (DMG) (ZIP)
Demonstrates creating a custom control by creating a clock control, implemented as a subclass of NSControl and NSCell.
User Experience 2003-02-25
Cocoa - SGDataProc (HTML) (DMG) (ZIP)
Uses a Sequence Grabber data function and an NSQuickDrawView to simulate a preview operation for captured video.
QuickTime 2003-01-14
Cocoa CG aliasing demo (HTML) (DMG) (ZIP)
Shows how to draw both aliased and anti-aliased text and graphics using Quartz and Cocoa.
Graphics & Imaging 2003-07-17
Cocoa CG arc demo (HTML) (DMG) (ZIP)
Shows how to draw both aliased and anti-aliased arcs using Quartz and Cocoa.
Graphics & Imaging 2003-07-17
Cocoa OpenGL (HTML) (DMG) (ZIP)
Demonstrates using Cocoa with OpenGL, including window setup and event handling.
Graphics & Imaging 2007-10-22
Cocoa_With_Carbon_or_CPP (HTML) (DMG) (ZIP)
Shows how to call Carbon routines and C++ code from within an Objective-C Cocoa program.
Design Guidelines, Objective-C Language, User Experience 2007-02-05
CocoaDragAndDrop (HTML) (DMG) (ZIP)
Implement Drag-and-Drop functionality in Cocoa (uses images; can be extended to support other data types).
Events & Other Input, Interapplication Communication 2003-01-14
CocoaEcho (HTML) (DMG) (ZIP)
Cocoa example code showing how to write a simple client and server using NSStream.
Networking 2005-06-01
CocoaHTTPServer (HTML) (DMG) (ZIP)
A Cocoa example showing how to write a very basic HTTP service.
Networking 2005-06-01
CocoaInCarbon (HTML) (DMG) (ZIP)
Demonstrates using Cocoa GUI code in a Carbon application.
Runtime Architecture 2005-10-04
CocoaPeoplePicker (HTML) (DMG) (ZIP)
Demonstrates how to use the AddressBook framework's ABPeoplePickerView.
Apple Applications 2003-12-11
CocoaSlides (HTML) (DMG) (ZIP)
An image browser written using AppKit's Core Animation-based compositing and animation functionality
Games, Graphics & Imaging, User Experience 2007-11-02
CocoaSOAP (HTML) (DMG) (ZIP)
Demonstrates implementing a SOAP client and server in Cocoa.
Networking 2005-06-06
CocoaVideoFrameToGWorld (HTML) (DMG) (ZIP)
Demonstrates how to draw each frame of a QuickTime movie into a Cocoa NSQuickDrawView.
QuickTime 2003-01-14
CocoaVideoFrameToNSImage (HTML) (DMG) (ZIP)
Demonstrates how to create an NSImage for each frame of a QuickTime movie.
QuickTime 2003-01-14
Color Sampler (HTML) (DMG) (ZIP)
Demonstrates one way to sample the color at a given point in an NSView.
Events & Other Input, Graphics & Imaging, User Experience 2003-01-14
ColorBars (HTML) (DMG) (ZIP)
Shows how to enumerate, select, capture, manipulate, draw to, and release displays using the CGDirectDisplay API.
Graphics & Imaging 2003-01-14
ColorMatching (HTML) (DMG) (ZIP)
Performs simple color matching of images using ColorSync or the QuickTime 6.4 Graphics Importers.
Graphics & Imaging 2003-12-18
ColorSyncDevices-Cocoa (HTML) (DMG) (ZIP)
Demonstrates how to use the new ColorSync Device Manager routines in the Cocoa environment.
Events & Other Input, Graphics & Imaging 2003-01-14
ContentBurn (HTML) (DMG) (ZIP)
Creates an audio CD using standard audio files like mp3, aac, aiff, and wav.
File Management 2003-10-27
Core Animation QuickTime Layer (HTML) (DMG) (ZIP)
Shows the use of controls in a Layer over a Core Animation QTMovieLayer
Graphics & Imaging 2007-09-26
Core Data HTML Store (HTML) (DMG) (ZIP)
Implementation of a Core Data atomic store based on HTML tables
Data Management 2007-06-01
CoreRecipes (HTML) (DMG) (ZIP)
Demonstrates the use of Core Data (persistency and object-graph management) with a variety of application projects.
Data Management 2005-06-01
Cropped Image (HTML) (DMG) (ZIP)
Demonstrates how to extract a sub-image from another image, and some ways of indicating a selection.
Graphics & Imaging, User Experience 2003-01-14
CrossEvents (HTML) (DMG) (ZIP)
Demonstrates how to send CarbonEvents and NSNotifications between Carbon and Cocoa.
Events & Other Input, Process Management 2007-05-31
CryptoSample (HTML) (DMG) (ZIP)
Contains sample code showing symmetric encryption and message digest calculation.
Security 2003-02-06
CTMClip (HTML) (DMG) (ZIP)
Deprecated - Shows how to manipulate the Quartz 2D Current Transform Matrix (CTM) for image drawing with clipping.
Graphics & Imaging 2003-01-14
CTMDemo (HTML) (DMG) (ZIP)
Deprecated - Shows how to manipulate the Quartz 2D Current Transform Matrix (CTM) for image drawing without clipping.
Graphics & Imaging 2003-01-14
CubePuzzle (HTML) (DMG) (ZIP)
Models a Rubik's Cube using Cocoa and OpenGL
Games, Graphics & Imaging 2003-04-21
CustomAtomicStoreSubclass (HTML) (DMG) (ZIP)
Illustrates the implementation of a custom Core Data atomic store.
Data Management 2007-06-08
CustomSave (HTML) (DMG) (ZIP)
Demonstrates how to customize the NSSavePanel.
File Management, User Experience 2007-06-11
DataBurn (HTML) (DMG) (ZIP)
Demonstrates how to create a DRFolder and burn it to disc.
File Management 2005-03-17
DatePicker (HTML) (DMG) (ZIP)
Demonstrates how to use the NSDatePicker control.
User Experience 2007-04-25
Departments and Employees (HTML) (DMG) (ZIP)
Source code for NSPersistentDocument Core Data Tutorial.
Data Management 2007-05-31
DerivedProperty (HTML) (DMG) (ZIP)
Illustrates use of Core Data derived properties to make searching against string data more efficient.
Data Management, Performance, Text & Fonts 2008-06-04
DeskPictAppDockMenu (HTML) (DMG) (ZIP)
How to add a dynamic Dock menu to your Cocoa application
File Management, User Experience 2003-01-14
DeviceListener (HTML) (DMG) (ZIP)
Uses the DiscRecording framework to listen for device plug/unplug events and media insertion events.
File Management 2003-07-17
Dicey (HTML) (DMG) (ZIP)
Dicey is a dice game project that demonstrates various techniques for making a Cocoa application accessible.
Accessibility, Events & Other Input 2006-08-01
DictionaryController (HTML) (DMG) (ZIP)
"DictionaryController" is a Cocoa application that demonstrates various ways in how to use the NSDictionaryController class.
Data Management, User Experience 2007-12-20
DockTile (HTML) (DMG) (ZIP)
Demonstrates how to customize your application's icon in the Dock by using the NSDockTile class.
User Experience 2007-09-11
DragItemAround (HTML) (DMG) (ZIP)
Illustrates creating a custom subclass of NSView.
Graphics & Imaging 2006-03-16
DynamicProperties (HTML) (DMG) (ZIP)
Demonstrates dynamically resolved properties, using a new Objective C 2.0 feature: dynamically resolved methods.
Objective-C Language 2006-08-01
EnhancedAudioBurn (HTML) (DMG) (ZIP)
This Objective-C sample demonstrates how to burn RedBook Audio CDs.
File Management 2005-07-06
EnhancedDataBurn (HTML) (DMG) (ZIP)
Objective-C sample which shows how to burn a data disc containing a complete virtual filesystem.
File Management 2003-01-14
Eraser (HTML) (DMG) (ZIP)
Uses the DiscRecordingUI framework to present the standard erase, selection and progress dialogs.
File Management 2003-01-14
ExtractMovieAudioToAIFF (HTML) (DMG) (ZIP)
Demonstrates how to extract audio from QuickTime Movies and write the data to an AIFF file.
Audio, QuickTime 2006-03-31
FancyAbout (HTML) (DMG) (ZIP)
Demonstrates several visual effects for "About..." panels such as scrolling text, window without a title bar, and ways to dismiss the window.
Graphics & Imaging, User Experience 2003-10-27
Fiendishthngs (HTML) (DMG) (ZIP)
Fiendishthngs lists all the the Components it finds on the system and lets you query them for information.
QuickTime 2007-09-13
File Wrappers with Core Data Documents (HTML) (DMG) (ZIP)
This sample demonstrates how directory file wrappers can be used with NSPersistentDocument.
Data Management, File Management 2009-04-29
FileNotification (HTML) (DMG) (ZIP)
kqueue file notification introduced in 10.3. Notification API to detect file system modifications.
File Management 2005-10-27
filesystem_examples (HTML) (DMG) (ZIP)
Collection of command line tools illustrating filesystem features.
File Management 2006-01-10
FSCopyObject (HTML) (DMG) (ZIP)
Copy engine for copying files and directories.
File Management 2004-03-19
FSMegaInfo (HTML) (DMG) (ZIP)
Prints information about various file system objects; helpful when debugging VFS plug-ins.
File Management 2008-02-25
FunkyOverlayWindow (HTML) (DMG) (ZIP)
Demonstrates several window layering, transparency and widget interaction techniques in Cocoa.
Events & Other Input, Graphics & Imaging, User Experience 2003-05-08
GeekGameBoard (HTML) (DMG) (ZIP)
Shows how to use Core Animation for the user interface of a board or card game.
Games, Graphics & Imaging 2007-12-19
GetMACAddressSample (HTML) (DMG) (ZIP)
Demonstrates how to retrieve the MAC address for each Ethernet interface from the Mac OS X I/O Registry.
Networking, Security 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.
Networking, Security 2005-10-27
GLChildWindowDemo (HTML) (DMG) (ZIP)
Shows using Cocoa's child windows and Quartz Extreme to provide 2D/3D overlays above 3D content.
Graphics & Imaging 2003-04-21
GLSLShowpiece (HTML) (DMG) (ZIP)
GLSLShowpiece demonstrates several Vertex and Fragment shaders
Games, Graphics & Imaging 2006-07-17
Grady (HTML) (DMG) (ZIP)
Demonstrates how to use the NSGradient class.
Graphics & Imaging, User Experience 2007-02-28
GridCalendar (HTML) (DMG) (ZIP)
Demonstrates how to add a custom job submission UI to the GridSample project.
Networking 2005-06-01
IconCollection (HTML) (DMG) (ZIP)
Demonstrates how to use NSCollectionView along with NSWorkspace and named images to determine its content.
User Experience 2008-01-18
Image Difference (HTML) (DMG) (ZIP)
Demonstrates a way to use Quartz's compositing capability to find the difference between two images.
Graphics & Imaging 2003-01-30
Image Kit with Core Data (HTML) (DMG) (ZIP)
Using Image Kit's browser view with Core Data content.
Data Management, Graphics & Imaging, User Experience 2008-07-25
ImageBackground (HTML) (DMG) (ZIP)
Shows how to draw an image in the background of an NSOutlineView and NSTableView.
Graphics & Imaging, User Experience 2006-10-02
ImageBrowser (HTML) (DMG) (ZIP)
Demonstrates the ImageKit's IKImageBrowserView to browse images in a basic Cocoa application.
Graphics & Imaging 2007-03-13
ImageClient (HTML) (DMG) (ZIP)
Demonstrates how to use CFNetwork for synchronous and asynchronous operations, network diagnostics, proxy navigation, and authentication.
Networking 2005-06-01
ImageMapExample (HTML) (DMG) (ZIP)
Implements a custom NSView, an image map, and accessorizes it (i.e. makes it work with accessibility).
Accessibility 2005-06-01
ImagesToQTMovie (HTML) (DMG) (ZIP)
Creates a QuickTime movie from the images of any connected camera.
QuickTime 2003-01-14