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

Sort by
Title
Sorted by
Topic
Sort by
Date
BoingX (HTML) (DMG) (ZIP)
Shows off using Quartz Extreme to provide borderless OpenGL content on the desktop.
Graphics & Imaging 2007-11-06
CALayerEssentials (HTML) (DMG) (ZIP)
Demonstrates the basics of setting up various Core Animation layers
Graphics & Imaging 2008-09-30
CarbonCocoaCoreImageTab (HTML) (DMG) (ZIP)
Carbon-based application creates a Cocoa-based web window which used CoreImage filters to transition between tabbed WebViews
Graphics & Imaging 2006-07-25
CarbonQuartzComposer_TV (HTML) (DMG) (ZIP)
Demonstrates how to integrate Cocoa based QuartzComposer window into a Carbon based application
Graphics & Imaging 2006-10-02
CGDrawPicture (HTML) (DMG) (ZIP)
Deprecated - Shows how to use the QDPictDrawToCGContext API.
Graphics & Imaging 2003-01-14
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
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
CocoaSlides (HTML) (DMG) (ZIP)
An image browser written using AppKit's Core Animation-based compositing and animation functionality
Graphics & Imaging 2007-11-02
Color Sampler (HTML) (DMG) (ZIP)
Demonstrates one way to sample the color at a given point in an NSView.
Graphics & Imaging 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.
Graphics & Imaging 2003-01-14
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
Cropped Image (HTML) (DMG) (ZIP)
Demonstrates how to extract a sub-image from another image, and some ways of indicating a selection.
Graphics & Imaging 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 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
Graphics & Imaging 2003-04-21
DragItemAround (HTML) (DMG) (ZIP)
Illustrates creating a custom subclass of NSView.
Graphics & Imaging 2006-03-16
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 2003-10-27
FunkyOverlayWindow (HTML) (DMG) (ZIP)
Demonstrates several window layering, transparency and widget interaction techniques in Cocoa.
Graphics & Imaging 2003-05-08
GeekGameBoard (HTML) (DMG) (ZIP)
Shows how to use Core Animation for the user interface of a board or card game.
Graphics & Imaging 2007-12-19
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
Graphics & Imaging 2006-07-17
Grady (HTML) (DMG) (ZIP)
Demonstrates how to use the NSGradient class.
Graphics & Imaging 2007-02-28
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.
Graphics & Imaging 2008-07-25
ImageBackground (HTML) (DMG) (ZIP)
Shows how to draw an image in the background of an NSOutlineView and NSTableView.
Graphics & Imaging 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
LayerBackedOpenGLView (HTML) (DMG) (ZIP)
"LayerBackedOpenGLView" provides a simple example of hosting Cocoa controls as subviews of an NSOpenGLView.
Graphics & Imaging 2007-06-12
Link Snoop (HTML) (DMG) (ZIP)
Shows how to use PDFKit to scan for and highlight link annotations in PDFs.
Graphics & Imaging 2005-06-01
LiveVideoMixer3 (HTML) (DMG) (ZIP)
LiveVideoMixer3 is extended to support Video In via QTKit
Graphics & Imaging 2006-08-01
MassiveImage (HTML) (DMG) (ZIP)
Shows how to use a CGDataProvider to save a very large image with Image IO
Graphics & Imaging 2007-09-27
Monochrome Image (HTML) (DMG) (ZIP)
Applies the NTSC color weighting formula to an image to generate a monochrome version of the image.
Graphics & Imaging 2003-07-16
MyCustomColorPicker (HTML) (DMG) (ZIP)
Shows how to write a custom color picker using Cocoa.
Graphics & Imaging 2006-10-09
NSGLImage (HTML) (DMG) (ZIP)
Deprecated - Demonstrates how to texture in OpenGL with an NSImage and/or NSBitmapImageRep
Graphics & Imaging 2004-12-01
NSOpenGL Fullscreen (HTML) (DMG) (ZIP)
Demonstrates how to create and switch between windowed and fullscreen OpenGL contexts using NSOpenGL.
Graphics & Imaging 2004-02-11
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
Graphics & Imaging 2008-02-06
OpenGL Screensaver (HTML) (DMG) (ZIP)
Demonstrates how to integrate OpenGL drawing into a standard Cocoa screen saver on Mac OS X.
Graphics & Imaging 2003-12-10
OpenGLCompositorLab (HTML) (DMG) (ZIP)
Demonstrates using OpenGL to composite multiple sources in hardware. Requires NVIDIA GeForce 4 Ti hardware.
Graphics & Imaging 2003-04-21
PDF Annotation Editor (HTML) (DMG) (ZIP)
Demonstrates how to use PDF Kit to examine, edit, and create PDF annotations.
Graphics & Imaging 2006-07-31
PDF Calendar (HTML) (DMG) (ZIP)
Demonstrates how to use PDF Kit to create PDF content.
Graphics & Imaging 2006-07-31
PDFKitLinker2 (HTML) (DMG) (ZIP)
Demonstrates many aspects of PDFKit including navigation, display modes, searching, and PDFView subclassing.
Graphics & Imaging 2005-08-10
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 2003-01-23
PictureTaker (HTML) (DMG) (ZIP)
Demonstrates the PictureTaker in a basic Cocoa application
Graphics & Imaging 2007-04-02
Polygons (HTML) (DMG) (ZIP)
Demonstrates the NSBezierPath class, as well as the manipulation of NSView's coordinate space for convenience.
Graphics & Imaging 2003-01-14
QCFundamentals (HTML) (DMG) (ZIP)
Demonstrates Coordinate, Interpolation, and Iterative systems in Quartz Composer with an amusing animation
Graphics & Imaging 2006-08-07
QCGalaxy (HTML) (DMG) (ZIP)
Demonstrates use of Particle Systems and Core Image Filters in Quartz Composer
Graphics & Imaging 2006-08-07
QTCoreImage101 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using Core Image filters and the new video pipeline.
Graphics & Imaging 2005-07-19
QTCoreVideo102 (HTML) (DMG) (ZIP)
An application demonstrating the use of QTKit, CoreVdeo, and OpenGL.
Graphics & Imaging 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.
Graphics & Imaging 2008-06-06
QTCoreVideo201 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using OpenGL FBO and the Core Video texture pipeline.
Graphics & Imaging 2008-06-06
QTCoreVideo202 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using OpenGL PBO and the Core Video pixel buffer pipeline.
Graphics & Imaging 2009-04-07
QTCoreVideo301 (HTML) (DMG) (ZIP)
Demonstrates adding of effects & filters to QuickTime Movies in realtime using GLSL shaders and the Core Video texture pipeline.
Graphics & Imaging 2009-04-07
QTtoCG (HTML) (DMG) (ZIP)
Shows how to create a CGImageRef with the proper ColorSync profile from a QuickTime image on disk.
Graphics & Imaging 2003-01-14
Quartz 2D Shadings (HTML) (DMG) (ZIP)
Shows how to use CGShading and CGGradient objects to draw simple gradients.
Graphics & Imaging 2007-08-31
Quartz 2D Transformer (HTML) (DMG) (ZIP)
Shows how to use Quartz 2D to manipulate an image
Graphics & Imaging 2007-06-21
Quartz Composer Live DV (HTML) (DMG) (ZIP)
Shows how to export a Quartz Composer composition as a real-time DV stream on the FireWire port.
Graphics & Imaging 2005-06-01
Quartz Composer Matrix (HTML) (DMG) (ZIP)
Shows how to use Quartz Composer to display a QuickTime movie as a series of frames in a 3D world.
Graphics & Imaging 2005-06-01
Quartz Composer Offline Rendering (HTML) (DMG) (ZIP)
Shows how to render a Quartz Composer composition as a series of images using an OpenGL pBuffer.
Graphics & Imaging 2005-06-01
Quartz Composer QCTV (HTML) (DMG) (ZIP)
Shows how to build a fake TV system using Quartz Composer as the foundation motion graphics.
Graphics & Imaging 2005-07-06
Quartz Composer Texture (HTML) (DMG) (ZIP)
Shows how to use a Quartz Composer composition as an OpenGL texture.
Graphics & Imaging 2005-06-01
Quartz Composer WWDC 2005 Composition (HTML) (DMG) (ZIP)
Shows how to build a parameterized motion graphics composition with Quartz Composer.
Graphics & Imaging 2005-06-01
Quartz Composer WWDC 2005 TextEdit (HTML) (DMG) (ZIP)
Demonstrate how to modify TextEdit's about dialog to display a Quartz Composer composition.
Graphics & Imaging 2005-06-01
Quartz EB (HTML) (DMG) (ZIP)
WWDC 2001 Early Bird Quartz 2D tutorial of vector drawing and PDF import/export.
Graphics & Imaging 2003-01-14
Quartz2DBasics (HTML) (DMG) (ZIP)
Carbon and Cocoa sample code demonstrating some basic usage of the Quartz 2D API
Graphics & Imaging 2006-09-11
QuartzComposerSamplePatches (HTML) (DMG) (ZIP)
A short list of new patches in Quartz Composer Mac OS X 10.5
Graphics & Imaging 2007-06-11
QuartzLines (HTML) (DMG) (ZIP)
Drawing Lines using Quartz's CGPath & CGContextStrokeLineSegments functions.
Graphics & Imaging 2005-06-01
Reducer (HTML) (DMG) (ZIP)
Simple utility for rescaling bitmapped images. Demonstrates use of Core Image, NSAnimation, view drawing redirection.
Graphics & Imaging 2005-06-06
RGB Image (HTML) (DMG) (ZIP)
Demonstrates compositing to separate an NSimage into its RGB components, and how to recombine those components.
Graphics & Imaging 2003-01-14
RGB ValueTransformers (HTML) (DMG) (ZIP)
Supersedes the "RGB Image sample". Sample now uses bindings. Color separation now done in an NSValueTransformer subclass.
Graphics & Imaging 2003-11-18
RoundTransparentWindow (HTML) (DMG) (ZIP)
Creating (in Cocoa) custom-shaped windows and transparent window content; plus changing the shape of windows dynamically.
Graphics & Imaging 2003-01-14
SimpleCocoaJavaMovieCocoa (HTML) (DMG) (ZIP)
Deprecated - Shows how to use the NSMovieView and NSMovie Cocoa Java AppKit classes.
Graphics & Imaging 2003-01-14
Son of Grab (HTML) (DMG) (ZIP)
Shows how to use the new CGWindow to get window images from the Window Server.
Graphics & Imaging 2007-11-01
SonOfSillyBalls (HTML) (DMG) (ZIP)
Draws a bunch of randomly colored, randomly placed, silly balls in a window on the screen.
Graphics & Imaging 2003-01-14
Squiggles (HTML) (DMG) (ZIP)
Demonstrates many Cocoa fundamentals in a Document-based Application featuring custom drawing and event-handling.
Graphics & Imaging 2008-08-29
TexturePerformanceDemo (HTML) (DMG) (ZIP)
OpenGL texture optimization demo for WWDC Session 214
Graphics & Imaging 2005-06-01
Tinted Image (HTML) (DMG) (ZIP)
Demonstrates the use of an NSImage as an off-screen drawing destination.
Graphics & Imaging 2003-01-14
Transformed Image (HTML) (DMG) (ZIP)
Shows the effects of a rendering an NSImage in a transformed coordinate space.
Graphics & Imaging 2003-01-14
UnsharpMask (HTML) (DMG) (ZIP)
Demonstrates how to build Automator actions using Cocoa frameworks.
Graphics & Imaging 2005-06-06
VBL (HTML) (DMG) (ZIP)
A simple example of how to create an OpenGLView in AppKit.
Graphics & Imaging 2003-07-07
VertexPerformanceDemo (HTML) (DMG) (ZIP)
Vertex optimization demo for WWDC Session 214
Graphics & Imaging 2005-06-01
Video Hardware Info (HTML) (DMG) (ZIP)
Sample demonstrates how to query the video hardware for useful information.
Graphics & Imaging 2004-02-12
VideoHardwareInfo (HTML) (DMG) (ZIP)
Query VRAM, Quartz Extreme support, OpenGL extensions and renderer, GLSL version and support.
Graphics & Imaging 2007-05-14
VideoViewer (HTML) (DMG) (ZIP)
Simple example of video rendering using QuickTime visual contexts, OpenGL, Core Video and Core Image.
Graphics & Imaging 2005-08-01
Worm (HTML) (DMG) (ZIP)
NSView performance demonstration. Uses a periodic timer to get best performance with Coalesced Update feature.
Graphics & Imaging 2005-06-01
ABPresence (HTML) (DMG) (ZIP)
Displays a list of all the people in your Address Book and their iChat status.
Interapplication Communication 2006-08-04
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
AttachAScript (HTML) (DMG) (ZIP)
Illustrates how you can extend any Cocoa application by adding some AppleScripts to it.
Interapplication Communication 2006-07-27
CocoaDragAndDrop (HTML) (DMG) (ZIP)
Implement Drag-and-Drop functionality in Cocoa (uses images; can be extended to support other data types).
Interapplication Communication 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 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.
Interapplication Communication 2003-01-14
PasteboardPeeker (HTML) (DMG) (ZIP)
Using pasteboards for Copy and Paste, Drag and Drop, service support and filter services.
Interapplication Communication 2005-08-10
SBSendEmail (HTML) (DMG) (ZIP)
Using the Scripting Bridge to tell Mail.app to send an email message with an optional attachment.
Interapplication Communication 2008-02-28
SBSystemPrefs (HTML) (DMG) (ZIP)
Shows how to use Scripting Bridge to display a preference pane in System Preferences.
Interapplication Communication 2008-10-13
ScriptingBridgeiCal (HTML) (DMG) (ZIP)
Adding/updating events in iCal using Scripting Bridge.
Interapplication Communication 2007-12-13
SimpleThreads (HTML) (DMG) (ZIP)
Uses the Cocoa threading APIs to coordinate multiple preemptively scheduled secondary threads with the non-reentrant Cocoa framework.
Interapplication Communication 2003-01-14