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
TrackFormatDemo (HTML) (DMG) (ZIP)
Shows how to get a human-readable, localized description of a track's format.
QuickTime 2006-08-01
VideoViewer (HTML) (DMG) (ZIP)
Simple example of video rendering using QuickTime visual contexts, OpenGL, Core Video and Core Image.
QuickTime 2005-08-01
WhackedTV (HTML) (DMG) (ZIP)
A Cocoa version of the venerable HackTV sample code, demonstrating usage of the Sequence Grabber API's
QuickTime 2008-05-09
WritableFileDemo (HTML) (DMG) (ZIP)
Shows how to create an empty, writable file associated with a QTMovie object.
QuickTime 2006-08-01
BundleLoader (HTML) (DMG) (ZIP)
Demonstrates how to load multiple Cocoa bundles or NSBundles (also known as plug-ins) into the main NSApplication.
Resource Management 2007-09-21
JDragNDrop (HTML) (DMG) (ZIP)
Deprecated - Demonstrates building a simple view to implement Drag-and-Drop functionality in Cocoa-Java.
Resource Management 2003-01-14
MapLargeFile (HTML) (DMG) (ZIP)
Shows a technique for mapping files greater than 4GB into memory for faster access.
Resource Management 2003-11-19
ViewController (HTML) (DMG) (ZIP)
Demonstrates how to use "NSViewController".
Resource Management 2007-06-11
BundleLoader (HTML) (DMG) (ZIP)
Demonstrates how to load multiple Cocoa bundles or NSBundles (also known as plug-ins) into the main NSApplication.
Runtime Architecture 2007-09-21
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
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
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
CocoaInCarbon (HTML) (DMG) (ZIP)
Demonstrates using Cocoa GUI code in a Carbon application.
Runtime Architecture 2005-10-04
SimpleThreads (HTML) (DMG) (ZIP)
Uses the Cocoa threading APIs to coordinate multiple preemptively scheduled secondary threads with the non-reentrant Cocoa framework.
Runtime Architecture 2003-01-14
SonOfSillyBalls (HTML) (DMG) (ZIP)
Draws a bunch of randomly colored, randomly placed, silly balls in a window on the screen.
Runtime Architecture 2003-01-14
SpellingChecker CarbonCocoa Bundled (HTML) (DMG) (ZIP)
How to load and call a Cocoa bundle from a Carbon CFM or Mach-O application
Runtime Architecture 2004-08-17
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 2003-01-14
SpellingChecker-CocoaCarbon (HTML) (DMG) (ZIP)
Demonstrates how to call NSSpellChecker cocoa routines from a Carbon application.
Runtime Architecture 2005-08-10
TrivialThreads (HTML) (DMG) (ZIP)
Uses the Cocoa threading APIs to coordinate a preemptively scheduled secondary thread with the non-reentrant Cocoa framework.
Runtime Architecture 2003-01-14
AutoSample (HTML) (DMG) (ZIP)
How to run and display Automator workflows in your application.
Scripting & Automation 2007-05-23
SBSendEmail (HTML) (DMG) (ZIP)
Using the Scripting Bridge to tell Mail.app to send an email message with an optional attachment.
Scripting & Automation 2008-02-28
SBSetFinderComment (HTML) (DMG) (ZIP)
Set/Get Finder Comments using Scripting Bridge
Scripting & Automation 2007-12-04
SBSystemPrefs (HTML) (DMG) (ZIP)
Shows how to use Scripting Bridge to display a preference pane in System Preferences.
Scripting & Automation 2008-10-13
ScriptingBridgeiCal (HTML) (DMG) (ZIP)
Adding/updating events in iCal using Scripting Bridge.
Scripting & Automation 2007-12-13
CryptoSample (HTML) (DMG) (ZIP)
Contains sample code showing symmetric encryption and message digest calculation.
Security 2003-02-06
GetMACAddressSample (HTML) (DMG) (ZIP)
Demonstrates how to retrieve the MAC address for each Ethernet interface from the Mac OS X I/O Registry.
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.
Security 2005-10-27
SSLSample (HTML) (DMG) (ZIP)
Contains examples showing how to use SecureTransport.
Security 2003-01-14
People (HTML) (DMG) (ZIP)
This program demonstrates the use of the SyncServices framework.
Syncing 2005-06-01
StickiesExample (HTML) (DMG) (ZIP)
Contains sample code and tools used by Sync Services Tutorial to demonstrate debugging syncing applications.
Syncing 2006-08-08
DerivedProperty (HTML) (DMG) (ZIP)
Illustrates use of Core Data derived properties to make searching against string data more efficient.
Text & Fonts 2008-06-04
InkSample (HTML) (DMG) (ZIP)
Demonstrates some usage scenarios for the Ink.Framework APIs.
Text & Fonts 2003-10-27
LayoutManagerDemo (HTML) (DMG) (ZIP)
Demonstrates the layout manager using rollovers with different colors for lines, words and characters under the mouse.
Text & Fonts 2003-01-14
NamingTableAccess (HTML) (DMG) (ZIP)
Digs out the contents of the NamingTable in a TrueType 'sfnt'.
Text & Fonts 2003-01-14
NSFontAttributeExplorer (HTML) (DMG) (ZIP)
Demonstrates how to gather and display various metric information for installed fonts using NSFont.
Text & Fonts 2006-10-26
PasteboardPeeker (HTML) (DMG) (ZIP)
Using pasteboards for Copy and Paste, Drag and Drop, service support and filter services.
Text & Fonts 2005-08-10
TextLayoutDemo (HTML) (DMG) (ZIP)
Customizing NSTextView with NSLayoutManager and a custom NSTextContainer.
Text & Fonts 2007-06-01
TextViewConfig (HTML) (DMG) (ZIP)
Configuration of multiple layout managers and multiple text container/text view pairs on a single text storage.
Text & Fonts 2003-01-14
TextViewDelegate (HTML) (DMG) (ZIP)
Demonstrates using a text view's delegate to control selection and user input.
Text & Fonts 2003-01-14
TipWrapper (HTML) (DMG) (ZIP)
Shows how to wrap long tool tips into multiple lines in Cocoa.
Text & Fonts 2003-12-18
JDragNDrop (HTML) (DMG) (ZIP)
Deprecated - Demonstrates building a simple view to implement Drag-and-Drop functionality in Cocoa-Java.
Tools 2003-01-14
Simon (HTML) (DMG) (ZIP)
A simple game demonstrating Cocoa development in Project Builder.
Tools 2003-01-14
AbstractTree (HTML) (DMG) (ZIP)
Using NSTreeController with NSOutlineView, Bindings, and Core Data.
User Experience 2008-03-17
AnimatedSlider (HTML) (DMG) (ZIP)
Demonstrates the use of an NSTimer to animate a control in Cocoa.
User Experience 2003-01-14
BasicCocoaAnimations (HTML) (DMG) (ZIP)
"BasicCocoaAnimations" demonstrates the use of the animator proxy to easily animate Cocoa views and windows.
User Experience 2007-06-11
BundleLoader (HTML) (DMG) (ZIP)
Demonstrates how to load multiple Cocoa bundles or NSBundles (also known as plug-ins) into the main NSApplication.
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
CarbonCocoa_PictureCursor (HTML) (DMG) (ZIP)
Demonstrates how to use NSCursor from a Carbon based application.
User Experience 2007-01-12
CarbonCocoaTempConverter (HTML) (DMG) (ZIP)
Demonstrates how to integrate Carbon and Cocoa user interfaces in the same Cocoa application.
User Experience 2008-03-10
CarbonInCocoa (HTML) (DMG) (ZIP)
How to use Carbon GUI code in a Cocoa application.
User Experience 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 2003-02-25
Cocoa_With_Carbon_or_CPP (HTML) (DMG) (ZIP)
Shows how to call Carbon routines and C++ code from within an Objective-C Cocoa program.
User Experience 2007-02-05
CocoaSlides (HTML) (DMG) (ZIP)
An image browser written using AppKit's Core Animation-based compositing and animation functionality
User Experience 2007-11-02
Color Sampler (HTML) (DMG) (ZIP)
Demonstrates one way to sample the color at a given point in an NSView.
User Experience 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.
User Experience 2003-01-14
CustomSave (HTML) (DMG) (ZIP)
Demonstrates how to customize the NSSavePanel.
User Experience 2007-06-11
DatePicker (HTML) (DMG) (ZIP)
Demonstrates how to use the NSDatePicker control.
User Experience 2007-04-25
DeskPictAppDockMenu (HTML) (DMG) (ZIP)
How to add a dynamic Dock menu to your Cocoa application
User Experience 2003-01-14
DictionaryController (HTML) (DMG) (ZIP)
"DictionaryController" is a Cocoa application that demonstrates various ways in how to use the NSDictionaryController class.
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
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.
User Experience 2003-10-27
FunkyOverlayWindow (HTML) (DMG) (ZIP)
Demonstrates several window layering, transparency and widget interaction techniques in Cocoa.
User Experience 2003-05-08
Grady (HTML) (DMG) (ZIP)
Demonstrates how to use the NSGradient class.
User Experience 2007-02-28
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 Kit with Core Data (HTML) (DMG) (ZIP)
Using Image Kit's browser view with Core Data content.
User Experience 2008-07-25
ImageBackground (HTML) (DMG) (ZIP)
Shows how to draw an image in the background of an NSOutlineView and NSTableView.
User Experience 2006-10-02
iSpend (HTML) (DMG) (ZIP)
Demonstrates how to incorporate a number of Cocoa Tiger features into a simple application.
User Experience 2005-06-01
JavaFrameEmbedding example (HTML) (DMG) (ZIP)
Small Cocoa application that demonstrates how to use JavaFrameEmbedding.framework
User Experience 2007-06-12
LayerBackedOpenGLView (HTML) (DMG) (ZIP)
"LayerBackedOpenGLView" provides a simple example of hosting Cocoa controls as subviews of an NSOpenGLView.
User Experience 2007-06-12
MenuItemView (HTML) (DMG) (ZIP)
Demonstrates embedding an NSView inside a menu item or NSMenuItem.
User Experience 2007-06-11
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.
User Experience 2003-01-14
MungSaver (HTML) (DMG) (ZIP)
Demonstrates a simple Screen Saver module for Panther, using the Sequence Grabber DataProc mung technique.
User Experience 2003-11-18
MyCustomColorPicker (HTML) (DMG) (ZIP)
Shows how to write a custom color picker using Cocoa.
User Experience 2006-10-09
ObjectPath (HTML) (DMG) (ZIP)
Demonstrates how to use the NSPathControl class.
User Experience 2007-05-22
OpenGL Screensaver (HTML) (DMG) (ZIP)
Demonstrates how to integrate OpenGL drawing into a standard Cocoa screen saver on Mac OS X.
User Experience 2003-12-10
PhotoSearch (HTML) (DMG) (ZIP)
Demonstrates advanced controls and cells. Custom drawing, hit testing, tracking, editing, expansion tooltips, tracking areas.
User Experience 2008-03-05
PredicateEditorSample (HTML) (DMG) (ZIP)
Demonstrates how to use the NSPredicateEditor class.
User Experience 2007-06-06
PrefsPane (HTML) (DMG) (ZIP)
A Cocoa sample System Preferences bundle that demonstrates how to use the NSPreferencePane class.
User Experience 2007-06-06
Reducer (HTML) (DMG) (ZIP)
Simple utility for rescaling bitmapped images. Demonstrates use of Core Image, NSAnimation, view drawing redirection.
User Experience 2005-06-06
RGB Image (HTML) (DMG) (ZIP)
Demonstrates compositing to separate an NSimage into its RGB components, and how to recombine those components.
User Experience 2003-01-14
RoundTransparentWindow (HTML) (DMG) (ZIP)
Creating (in Cocoa) custom-shaped windows and transparent window content; plus changing the shape of windows dynamically.
User Experience 2003-01-14
SearchField (HTML) (DMG) (ZIP)
Demonstrates how to use and customize the features of the "NSSearchField" control.
User Experience 2007-04-25
SimpleCocoaApp (HTML) (DMG) (ZIP)
A basic Cocoa application for beginners to Cocoa and Objective-C.
User Experience 2007-08-07
SonOfSillyBalls (HTML) (DMG) (ZIP)
Draws a bunch of randomly colored, randomly placed, silly balls in a window on the screen.
User Experience 2003-01-14
SourceView (HTML) (DMG) (ZIP)
Demonstrates how to use NSOutlineView driven by NSTreeController.
User Experience 2007-11-15
SpeedometerView (HTML) (DMG) (ZIP)
Shows how to make a custom NSView.
User Experience 2007-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.
User Experience 2008-06-06
Sproing (HTML) (DMG) (ZIP)
Shows how "springs" work to control view resizing behavior.
User Experience 2003-05-20
Squiggles (HTML) (DMG) (ZIP)
Demonstrates many Cocoa fundamentals in a Document-based Application featuring custom drawing and event-handling.
User Experience 2008-08-29
StickiesExample (HTML) (DMG) (ZIP)
Contains sample code and tools used by Sync Services Tutorial to demonstrate debugging syncing applications.
User Experience 2006-08-08
TextLayoutDemo (HTML) (DMG) (ZIP)
Customizing NSTextView with NSLayoutManager and a custom NSTextContainer.
User Experience 2007-06-01
Tinted Image (HTML) (DMG) (ZIP)
Demonstrates the use of an NSImage as an off-screen drawing destination.
User Experience 2003-01-14
TipWrapper (HTML) (DMG) (ZIP)
Shows how to wrap long tool tips into multiple lines in Cocoa.
User Experience 2003-12-18
ToolbarSample (HTML) (DMG) (ZIP)
Demonstrates using the Cocoa NSToolbar/NSToolbarItem API to add customizable toolbars to windows. Includes advanced custom views.
User Experience 2003-01-14
TrackBall (HTML) (DMG) (ZIP)
Demonstrates how to build a custom control based on the NSControl class.
User Experience 2007-06-07
TrackIt (HTML) (DMG) (ZIP)
Demonstrates how to use the NSTrackingArea class.
User Experience 2007-03-05
TwoManyControllers (HTML) (DMG) (ZIP)
How to use an intermediate NSArrayController to populate an NSTableView across two to-many relationships.
User Experience 2007-02-23
ViewController (HTML) (DMG) (ZIP)
Demonstrates how to use "NSViewController".
User Experience 2007-06-11