Jump To:
Leopard Reference Library
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

Sort by
Title
Sort by
Topic
Sorted by
Resource Type
Sort by
Date
FunkyOverlayWindow (HTML) (DMG) (ZIP)
Demonstrates several window layering, transparency and widget interaction techniques in Cocoa.
Events & Other Input, Graphics & Imaging, User Experience Sample Code 2003-05-08
CubePuzzle (HTML) (DMG) (ZIP)
Models a Rubik's Cube using Cocoa and OpenGL
Games, Graphics & Imaging Sample Code 2003-04-21
GLChildWindowDemo (HTML) (DMG) (ZIP)
Shows using Cocoa's child windows and Quartz Extreme to provide 2D/3D overlays above 3D content.
Graphics & Imaging Sample Code 2003-04-21
OpenGLCompositorLab (HTML) (DMG) (ZIP)
Demonstrates using OpenGL to composite multiple sources in hardware. Requires NVIDIA GeForce 4 Ti hardware.
Graphics & Imaging, QuickTime Sample Code 2003-04-21
CarbonInCocoa (HTML) (DMG) (ZIP)
How to use Carbon GUI code in a Cocoa application.
Events & Other Input, User Experience Sample Code 2003-03-26
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 Sample Code 2003-02-25
CryptoSample (HTML) (DMG) (ZIP)
Contains sample code showing symmetric encryption and message digest calculation.
Security Sample Code 2003-02-06
Image Difference (HTML) (DMG) (ZIP)
Demonstrates a way to use Quartz's compositing capability to find the difference between two images.
Graphics & Imaging Sample Code 2003-01-30
PDFView (HTML) (DMG) (ZIP)
Shows how to display or print a multi-page PDF document and scroll an NSscrollview's contents by dragging.
Graphics & Imaging Sample Code 2003-01-23
AddressBookCocoa (HTML) (DMG) (ZIP)
Demonstrates some basic manipulations of the Mac OS X 10.2.x (and beyond) Address Book API.
Interapplication Communication Sample Code 2003-01-14
AnimatedSlider (HTML) (DMG) (ZIP)
Demonstrates the use of an NSTimer to animate a control in Cocoa.
User Experience Sample Code 2003-01-14
CGDrawPicture (HTML) (DMG) (ZIP)
Deprecated - Shows how to use the QDPictDrawToCGContext API.
Graphics & Imaging Sample Code 2003-01-14
Cocoa - SGDataProc (HTML) (DMG) (ZIP)
Uses a Sequence Grabber data function and an NSQuickDrawView to simulate a preview operation for captured video.
QuickTime Sample Code 2003-01-14
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 Sample Code 2003-01-14
CocoaVideoFrameToGWorld (HTML) (DMG) (ZIP)
Demonstrates how to draw each frame of a QuickTime movie into a Cocoa NSQuickDrawView.
QuickTime Sample Code 2003-01-14
CocoaVideoFrameToNSImage (HTML) (DMG) (ZIP)
Demonstrates how to create an NSImage for each frame of a QuickTime movie.
QuickTime Sample Code 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 Sample Code 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 Sample Code 2003-01-14
ColorSyncDevices-Cocoa (HTML) (DMG) (ZIP)
Demonstrates how to use the new ColorSync Device Manager routines in the Cocoa environment.
Events & Other Input, Graphics & Imaging Sample Code 2003-01-14
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 Sample Code 2003-01-14
CTMClip (HTML) (DMG) (ZIP)
Deprecated - Shows how to manipulate the Quartz 2D Current Transform Matrix (CTM) for image drawing with clipping.
Graphics & Imaging Sample Code 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 Sample Code 2003-01-14
DeskPictAppDockMenu (HTML) (DMG) (ZIP)
How to add a dynamic Dock menu to your Cocoa application
File Management, User Experience Sample Code 2003-01-14
EnhancedDataBurn (HTML) (DMG) (ZIP)
Objective-C sample which shows how to burn a data disc containing a complete virtual filesystem.
File Management Sample Code 2003-01-14
Eraser (HTML) (DMG) (ZIP)
Uses the DiscRecordingUI framework to present the standard erase, selection and progress dialogs.
File Management Sample Code 2003-01-14
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 Sample Code 2003-01-14
ImagesToQTMovie (HTML) (DMG) (ZIP)
Creates a QuickTime movie from the images of any connected camera.
QuickTime Sample Code 2003-01-14
JDragNDrop (HTML) (DMG) (ZIP)
Deprecated - Demonstrates building a simple view to implement Drag-and-Drop functionality in Cocoa-Java.
Data Management, Events & Other Input, File Management, Java, Resource Management, Tools Sample Code 2003-01-14
LayoutManagerDemo (HTML) (DMG) (ZIP)
Demonstrates the layout manager using rollovers with different colors for lines, words and characters under the mouse.
Text & Fonts Sample Code 2003-01-14
MoreFiles (HTML) (DMG) (ZIP)
Shows various File Manager operations (file copy, etc.) through a collection of high-level routines.
File Management Sample Code 2003-01-14
Moriarity (HTML) (DMG) (ZIP)
Implementing a Cocoa GUI that wraps command-line functionality, calling a UNIX task and presenting the results in a GUI.
Interapplication Communication, Porting Sample Code 2003-01-14
MP3 Player (HTML) (DMG) (ZIP)
How to wrap a command-line UNIX/Linux application in a Cocoa GUI, calling a the command-line app through NSTask.
Audio, Interapplication Communication, User Experience Sample Code 2003-01-14
NameAndAddress (HTML) (DMG) (ZIP)
A single window utility that gets a host name from an IP address or an IP address from a hostname.
Apple Applications, Networking Sample Code 2003-01-14
NamingTableAccess (HTML) (DMG) (ZIP)
Digs out the contents of the NamingTable in a TrueType 'sfnt'.
Text & Fonts Sample Code 2003-01-14
Polygons (HTML) (DMG) (ZIP)
Demonstrates the NSBezierPath class, as well as the manipulation of NSView's coordinate space for convenience.
Graphics & Imaging Sample Code 2003-01-14
QTGraphicsImport (HTML) (DMG) (ZIP)
Demonstrates how to use the QuickTime Graphics Importer to draw an image into a NSWindow using a NSQuickDrawView.
QuickTime Sample Code 2003-01-14
QTtoCG (HTML) (DMG) (ZIP)
Shows how to create a CGImageRef with the proper ColorSync profile from a QuickTime image on disk.
Graphics & Imaging, QuickTime Sample Code 2003-01-14
Quartz EB (HTML) (DMG) (ZIP)
WWDC 2001 Early Bird Quartz 2D tutorial of vector drawing and PDF import/export.
Graphics & Imaging Sample Code 2003-01-14
RGB Image (HTML) (DMG) (ZIP)
Demonstrates compositing to separate an NSimage into its RGB components, and how to recombine those components.
Events & Other Input, Graphics & Imaging, User Experience Sample Code 2003-01-14
RoundTransparentWindow (HTML) (DMG) (ZIP)
Creating (in Cocoa) custom-shaped windows and transparent window content; plus changing the shape of windows dynamically.
Graphics & Imaging, User Experience Sample Code 2003-01-14
SharedMemory (HTML) (DMG) (ZIP)
Shows how multiple applications can access the same memory using the Unix shmget system call.
Performance, Process Management Sample Code 2003-01-14
Simon (HTML) (DMG) (ZIP)
A simple game demonstrating Cocoa development in Project Builder.
Tools Sample Code 2003-01-14
SimpleCocoaJavaMovie (HTML) (DMG) (ZIP)
Deprecated - A simple movie player showing how to use the NSMovieView and NSMovie Cocoa Java classes.
Java, QuickTime Sample Code 2003-01-14
SimpleCocoaJavaMovieCocoa (HTML) (DMG) (ZIP)
Deprecated - Shows how to use the NSMovieView and NSMovie Cocoa Java AppKit classes.
Graphics & Imaging Sample Code 2003-01-14
SimpleCocoaMovie (HTML) (DMG) (ZIP)
Shows how to use the NSMovieView and NSMovie Cocoa AppKit classes.
QuickTime Sample Code 2003-01-14
SimpleCocoaMovieQT (HTML) (DMG) (ZIP)
A simple movie player showing how to use the NSMovieView and NSMovie Cocoa Objective-C classes.
QuickTime Sample Code 2003-01-14
SimpleThreads (HTML) (DMG) (ZIP)
Uses the Cocoa threading APIs to coordinate multiple preemptively scheduled secondary threads with the non-reentrant Cocoa framework.
Interapplication Communication, Performance, Process Management, Runtime Architecture Sample Code 2003-01-14
SonOfSillyBalls (HTML) (DMG) (ZIP)
Draws a bunch of randomly colored, randomly placed, silly balls in a window on the screen.
Events & Other Input, Graphics & Imaging, Runtime Architecture, User Experience Sample Code 2003-01-14
SpellingChecker-CarbonCocoa (HTML) (DMG) (ZIP)
Implements procedural C wrapper around the Cocoa NSSpellChecker, exports it as a Mach-O bundle called "SpellCheck.bundle"
Runtime Architecture Sample Code 2003-01-14
SSLSample (HTML) (DMG) (ZIP)
Contains examples showing how to use SecureTransport.
Security Sample Code 2003-01-14
TextViewConfig (HTML) (DMG) (ZIP)
Configuration of multiple layout managers and multiple text container/text view pairs on a single text storage.
Text & Fonts Sample Code 2003-01-14
TextViewDelegate (HTML) (DMG) (ZIP)
Demonstrates using a text view's delegate to control selection and user input.
Text & Fonts Sample Code 2003-01-14
Tinted Image (HTML) (DMG) (ZIP)
Demonstrates the use of an NSImage as an off-screen drawing destination.
Graphics & Imaging, User Experience Sample Code 2003-01-14
ToolbarSample (HTML) (DMG) (ZIP)
Demonstrates using the Cocoa NSToolbar/NSToolbarItem API to add customizable toolbars to windows. Includes advanced custom views.
Events & Other Input, User Experience Sample Code 2003-01-14
Transformed Image (HTML) (DMG) (ZIP)
Shows the effects of a rendering an NSImage in a transformed coordinate space.
Graphics & Imaging Sample Code 2003-01-14
TrivialThreads (HTML) (DMG) (ZIP)
Uses the Cocoa threading APIs to coordinate a preemptively scheduled secondary thread with the non-reentrant Cocoa framework.
Interapplication Communication, Performance, Process Management, Runtime Architecture Sample Code 2003-01-14
Observing Process Lifetimes Without Polling (HTML)
TN2050: Shows a variety of methods to observe process lifetimes without polling.
Process Management Technical Notes 2008-09-10
Mac OS X Code Signing In Depth (HTML)
TN2206: Intermediate to expert level overview of code signing that details specific options and gotchas
Security Technical Notes 2008-08-06
QTKit Frequently Asked Questions (HTML)
TN2138: Provides answers to many frequently asked QTKit questions.
QuickTime Technical Notes 2008-04-24
Managing QTCompressionOptions - An overview of the QTCompressionOptionsWindow sample (HTML)
TN2219: Introductory overview of the QTCompressionOptionsWindow sample demonstrating one way to manage QTCompressionOptions objects.
QuickTime Technical Notes 2008-03-11
Daemons and Agents (HTML)
TN2083: Describes the most common problems encountered with daemons and agents, and suggests detailed solutions.
Process Management Technical Notes 2007-11-05
Thread-safe programming in QuickTime (HTML)
TN2125: Discusses how to use QuickTime from background threads for applications and component developers.
QuickTime Technical Notes 2007-09-14
Using Secure Event Input Fairly (HTML)
TN2150: Describes the proper use of EnableSecureEventInput.
Events & Other Input, Security Technical Notes 2007-06-08
Querying Metadata With Spotlight (HTML)
TN2192: Describes how a Cocoa application can search Spotlight metadata.
File Management, User Experience Technical Notes 2007-06-04
Creating an About Panel in Your Cocoa Application (HTML)
TN2179: Describes different ways in implementing your Cocoa application's "About" panel.
User Experience Technical Notes 2007-01-22
Working Around Incorrect -needsToDrawRect: Behavior in Custom View Classes (HTML)
TN2107: Describes how to work around a bug in NSView's -needsToDrawRect: method.
Graphics & Imaging Technical Notes 2007-01-22
Using AppleScript Scripts in Cocoa Applications (HTML)
TN2084: Explains how to work with AppleScript scripts in your Cocoa application.
Scripting & Automation, User Experience Technical Notes 2006-09-19
Tagging Handle and Pointer Data References in QuickTime (HTML)
TN1195: The use of data reference extensions used by QuickTime to tag handle and pointer data references.
QuickTime Technical Notes 2006-08-30
JNI Development on Mac OS X (HTML)
TN2147: Discusses use of native APIs and UI elements from Java applications
Java Technical Notes 2006-04-17
Making the most of Cocoa bindings in Quartz Composer (HTML)
TN2146: Describes how to best use Cocoa bindings with Quartz Composer.
Graphics & Imaging Technical Notes 2006-03-03
Getting images in and out from Quartz Composer compositions (HTML)
TN2143: Describes how to efficiently pass images into and out of Quartz Composer
Graphics & Imaging Technical Notes 2005-10-04
Frequently Asked Text Services Manager (TSM) Questions (HTML)
TN2128: Regroups a collection of Text Services Manager (TSM) questions frequently asked by Input Method Developers
Events & Other Input, Text & Fonts Technical Notes 2005-06-24
OpenGL Release Highlights - Mac OS X 10.3 Panther (HTML)
TN2131: Contains a list of bugs along with a short description on a release-by-release basis
Games, Graphics & Imaging Technical Notes 2005-02-04
HFS Plus Volume Format (HTML) (日本語 HTML)
TN1150: Describes the physical layout of an HFS Plus volume.
File Management Technical Notes 2004-03-05
Scripting Interface Guidelines (HTML)
TN2106: Directions for providing a clean and consistent scripting interface for your application.
Scripting & Automation Technical Notes 2004-03-01
Understanding and Detecting OpenGL Functionality (HTML)
TN2080: Discusses OpenGL API design, and how to access the full power of hardware and software renderers.
Graphics & Imaging Technical Notes 2003-12-29
The Enhanced Print Apple Event (HTML)
TN2082: Describes an enhancement to the print Apple event that gives developers more control over scripted printing.
Printing Technical Notes 2003-12-09
Guide to Creating Kiosks on Mac OS X (HTML) (日本語 HTML)
TN2062: Discusses techniques used in creating applications which require kiosk-like functionality on Mac OS X.
User Experience Technical Notes 2003-02-24
Ensuring Backwards Binary Compatibility - Weak Linking and Availability Macros on Mac OS X (HTML) (日本語 HTML)
TN2064: Ensuring that Mach-O applications built using today's Mac OS X runs on previous versions of the OS.
Design Guidelines, Runtime Architecture Technical Notes 2003-02-18
Using collection classes safely with multithreaded applications (HTML) (日本語 HTML)
TN2059: Describes some problems with and workarounds for using mutable collection classes in multithreaded applications.
Process Management Technical Notes 2002-09-10
Mac OS X 10.2 (HTML)
TN2053: Describes software development-related changes provided in system software update Mac OS X 10.2.
Tools Technical Notes 2002-09-04
Exclusive File Access in Mac OS X (HTML) (日本語 HTML)
TN2037: Covers exclusive file access In Mac OS X
File Management Technical Notes 2002-05-01
Mac OS X: v10.1.1 - v10.1.3 (HTML)
TN2043: Describes changes provided by system software updates 10.1.1 through 10.1.3.
Tools Technical Notes 2002-03-06
File Manager Performance and Caching (HTML)
FL16: Discusses traditional Mac OS file system input/output performance issues and the File Manager's volume cache.
File Management Technical Notes 2000-09-01
Resolving Alias Files Quietly (HTML)
FL30: Describes how to resolve alias files on remote volumes without user interaction.
File Management Technical Notes 1999-11-01
Driving OpenGL Rendering Loops (HTML)
QA1385: Using Core Video display links (CVDisplayLink) or Cocoa timers (NSTimer) to drive an OpenGL rendering loop
Events & Other Input, Games, Graphics & Imaging Technical Q&As 2009-05-01
QuickTime Audio - Easy Frequency Level Metering with MovieAudio APIs (HTML)
QA1459: Describes how to perform frequency band level metering using MovieAudio metering APIs.
QuickTime Technical Q&As 2009-01-29
Core Animation properties and Reference Counting (HTML)
QA1565: Describes a discrepancy between the property declarations in Core Animation and the actual behavior.
Games, Graphics & Imaging, Objective-C Language, Resource Management Technical Q&As 2008-11-24
Animating the frame of a CALayer. (HTML)
QA1620: Explains how the frame property of a layer interacts with animations.
Graphics & Imaging Technical Q&As 2008-10-24
QTKit Capture - Disabling specific audio channels when recording (HTML)
QA1617: Describes how to disable specific audio channels when recording using QTKit Capture.
QuickTime Technical Q&As 2008-10-13
Programmatically causing restart, shutdown and/or logout (HTML) (日本語 HTML)
QA1134: Describes how to programmatically cause restart, shutdown, sleep or logout.
Events & Other Input, Process Management, Resource Management Technical Q&As 2008-09-24
Disabling Processor Cores on a Multi-Core System (HTML) (日本語 HTML)
QA1141: Describes how to disable processor cores on a multi-core system for testing purposes.
Performance Technical Q&As 2008-09-16
QTKit Capture - Video Compression Options And Preview (HTML)
QA1583: Describes how video compression options may influence the resolution of previewed video.
QuickTime Technical Q&As 2008-09-16
Determining if an application uses Objective-C Garbage Collection (HTML)
QA1599: Shows how to determine if an application or executable is using Objective-C Garbage Collection.
Objective-C Language Technical Q&As 2008-09-08
Expanding Tilde-based paths (HTML)
QA1549: Demonstrates how to resolve tilde-based relevant paths.
File Management Technical Q&As 2008-09-08
Getting the pixel data from a CGImage object (HTML)
QA1509: Describes how to access the pixel data of a CGImage object
Games, Graphics & Imaging Technical Q&As 2008-08-27
Gathering all PostScript Printer Descriptions (PPDs) (HTML)
QA1529: Describes a work around for an issue in PMCopyAvailablePPDs on Mac OS X 10.4 and below
Printing Technical Q&As 2008-08-08
Registering and unregistering for sleep and wake notifications (HTML)
QA1340: Explains how applications can register and unregister for sleep and wake notifications on Mac OS X.
Resource Management Technical Q&As 2008-08-08
Requirements for Quartz GL (HTML)
QA1536: Describes the requirements for enabling Quartz GL.
Games, Graphics & Imaging, Performance, User Experience Technical Q&As 2008-08-08
Using QTPixelBufferContextCreate with NewMovieFromProperties (HTML)
QA1443: Discusses using a QuickTime pixel buffer visual context and NewMovieFromProperties to output frames to pixel buffers.
QuickTime Technical Q&As 2008-08-08