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
SayIt (HTML) (DMG) (ZIP)
Web Kit plug-in which speaks text passed via JavaScript
Internet & Web 2006-08-04
SBSendEmail (HTML) (DMG) (ZIP)
Using the Scripting Bridge to tell Mail.app to send an email message with an optional attachment.
Interapplication Communication, Internet & Web, 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.
Interapplication Communication, Scripting & Automation 2008-10-13
ScriptingBridgeiCal (HTML) (DMG) (ZIP)
Adding/updating events in iCal using Scripting Bridge.
Interapplication Communication, Scripting & Automation 2007-12-13
SearchField (HTML) (DMG) (ZIP)
Demonstrates how to use and customize the features of the "NSSearchField" control.
Events & Other Input, User Experience 2007-04-25
SetMouseAcclSample (HTML) (DMG) (ZIP)
Find HID System Manager and get/set cursor acceleration
Accessibility, Events & Other Input 2006-11-28
SharedMemory (HTML) (DMG) (ZIP)
Shows how multiple applications can access the same memory using the Unix shmget system call.
Performance, Process Management 2003-01-14
SillyFrequencyLevels (HTML) (DMG) (ZIP)
Demonstrates how to obtain audio frequency levels from a Movie using SetMovieAudioFrequencyMeteringNumBands and GetMovieAudioFrequencyLevels APIs.
QuickTime 2006-01-25
Simon (HTML) (DMG) (ZIP)
A simple game demonstrating Cocoa development in Project Builder.
Tools 2003-01-14
Simple Bindings Adoption (HTML) (DMG) (ZIP)
A simple example that illustrates the adoption of Cocoa Bindings.
Data Management 2007-06-07
SimpleCalendar (HTML) (DMG) (ZIP)
Uses the Calendar Store framework to fetch iCal events and display them on a custom calendar.
Apple Applications 2006-07-27
SimpleCocoaApp (HTML) (DMG) (ZIP)
A basic Cocoa application for beginners to Cocoa and Objective-C.
Design Guidelines, User Experience 2007-08-07
SimpleCocoaJavaMovie (HTML) (DMG) (ZIP)
Deprecated - A simple movie player showing how to use the NSMovieView and NSMovie Cocoa Java classes.
Java, QuickTime 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
SimpleCocoaMovie (HTML) (DMG) (ZIP)
Shows how to use the NSMovieView and NSMovie Cocoa AppKit classes.
QuickTime 2003-01-14
SimpleCocoaMovieQT (HTML) (DMG) (ZIP)
A simple movie player showing how to use the NSMovieView and NSMovie Cocoa Objective-C classes.
QuickTime 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 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.
Events & Other Input, Graphics & Imaging, Runtime Architecture, User Experience 2003-01-14
SourceView (HTML) (DMG) (ZIP)
Demonstrates how to use NSOutlineView driven by NSTreeController.
File Management, User Experience 2007-11-15
SpecialPictureProtocol (HTML) (DMG) (ZIP)
Use a custom NSURLProtocol to create jpeg images in memory for display in a webView.
Internet & Web 2006-03-13
SpeedometerView (HTML) (DMG) (ZIP)
Shows how to make a custom NSView.
User Experience 2007-06-06
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
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.
File Management, 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.
Design Guidelines, Events & Other Input, Graphics & Imaging, Objective-C Language, User Experience 2008-08-29
SSLSample (HTML) (DMG) (ZIP)
Contains examples showing how to use SecureTransport.
Security 2003-01-14
StickiesExample (HTML) (DMG) (ZIP)
Contains sample code and tools used by Sync Services Tutorial to demonstrate debugging syncing applications.
Apple Applications, Syncing, User Experience 2006-08-08
StillMotion (HTML) (DMG) (ZIP)
Demonstrates how to use the QTKit Capture APIs to build a simple application that creates stop motion animations.
QuickTime 2007-11-14
TextLayoutDemo (HTML) (DMG) (ZIP)
Customizing NSTextView with NSLayoutManager and a custom NSTextContainer.
Text & Fonts, User Experience 2007-06-01
TextLinks (HTML) (DMG) (ZIP)
Programmatically creates links to URLs and other objects and handles clicks in non-URL links.
Networking 2003-07-29
TexturePerformanceDemo (HTML) (DMG) (ZIP)
OpenGL texture optimization demo for WWDC Session 214
Graphics & Imaging 2005-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
ThreadsExporter (HTML) (DMG) (ZIP)
Demonstrates importing and exporting still images in different formats on separate threads.
QuickTime 2005-07-26
ThreadsExportMovie (HTML) (DMG) (ZIP)
Demonstrates movie exporting using the QuickTime movie export component on separate threads of a Cocoa application.
QuickTime 2006-01-03
Tinted Image (HTML) (DMG) (ZIP)
Demonstrates the use of an NSImage as an off-screen drawing destination.
Graphics & Imaging, User Experience 2003-01-14
TipWrapper (HTML) (DMG) (ZIP)
Shows how to wrap long tool tips into multiple lines in Cocoa.
Text & Fonts, 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.
Events & Other Input, User Experience 2003-01-14
TrackBall (HTML) (DMG) (ZIP)
Demonstrates how to build a custom control based on the NSControl class.
Accessibility, Design Guidelines, Events & Other Input, User Experience 2007-06-07
TrackFormatDemo (HTML) (DMG) (ZIP)
Shows how to get a human-readable, localized description of a track's format.
QuickTime 2006-08-01
TrackIt (HTML) (DMG) (ZIP)
Demonstrates how to use the NSTrackingArea class.
User Experience 2007-03-05
Transformed Image (HTML) (DMG) (ZIP)
Shows the effects of a rendering an NSImage in a transformed coordinate space.
Graphics & Imaging 2003-01-14
TremoloUnit (HTML) (DMG) (ZIP)
Audio unit sample demonstrating how to build an effect unit with a generic view.
Audio 2006-10-26
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 2003-01-14
TwoManyControllers (HTML) (DMG) (ZIP)
How to use an intermediate NSArrayController to populate an NSTableView across two to-many relationships.
Data Management, Design Guidelines, User Experience 2007-02-23
UIElementInspector (HTML) (DMG) (ZIP)
Demonstrates using the Accessibility API introduced in Mac OS X 10.2, which allows manipulation of an application's UI.
Accessibility 2007-02-19
UnsharpMask (HTML) (DMG) (ZIP)
Demonstrates how to build Automator actions using Cocoa frameworks.
Apple Applications, Graphics & Imaging 2005-06-06
URL CacheInfo (HTML) (DMG) (ZIP)
Demonstrates resource caching behavior using the Cocoa URL loading system.
Networking, Performance 2008-06-05
VBL (HTML) (DMG) (ZIP)
A simple example of how to create an OpenGLView in AppKit.
Graphics & Imaging 2003-07-07
Verification (HTML) (DMG) (ZIP)
Objective-C example which demonstrates how to provide custom data verification for data written to disc.
File Management 2004-01-23
VertexPerformanceDemo (HTML) (DMG) (ZIP)
Vertex optimization demo for WWDC Session 214
Games, 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.
Games, 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, QuickTime 2005-08-01
ViewController (HTML) (DMG) (ZIP)
Demonstrates how to use "NSViewController".
Printing, Resource Management, User Experience 2007-06-11
Watcher (HTML) (DMG) (ZIP)
Uses FSEvents to monitor a directory hierarchy to keep track of its total size
File Management 2006-08-04
WebKitDOMElementPlugIn (HTML) (DMG) (ZIP)
A Web Kit plug-in that modifies its own DOM element style
Internet & Web 2006-08-04
WebKitPluginStarter (HTML) (DMG) (ZIP)
Shows how to make a minimal WebKit plug-in.
Internet & Web 2007-06-06
WebKitPluginWithJavaScript (HTML) (DMG) (ZIP)
Shows how to call JavaScript from a WebKit plug-in and vice versa.
Internet & Web 2007-06-06
WebKitPluginWithSimpleGUI (HTML) (DMG) (ZIP)
A WebKit plug-in with an Interface Builder GUI
Internet & Web 2007-06-04
WhackedTV (HTML) (DMG) (ZIP)
A Cocoa version of the venerable HackTV sample code, demonstrating usage of the Sequence Grabber API's
Audio, QuickTime 2008-05-09
With and Without Bindings (HTML) (DMG) (ZIP)
Illustrates the adoption of Cocoa Bindings and refactoring using a subclass of NSArrayController.
Data Management, Design Guidelines 2008-01-04
Worm (HTML) (DMG) (ZIP)
NSView performance demonstration. Uses a periodic timer to get best performance with Coalesced Update feature.
Graphics & Imaging, Performance 2005-06-01
WritableFileDemo (HTML) (DMG) (ZIP)
Shows how to create an empty, writable file associated with a QTMovie object.
QuickTime 2006-08-01