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
TrivialThreads (HTML) (DMG) (ZIP)
Uses the Cocoa threading APIs to coordinate a preemptively scheduled secondary thread with the non-reentrant Cocoa framework.
Interapplication Communication 2003-01-14
Mountains (HTML) (DMG) (ZIP)
Demonstrates localization and internationalization techniques and APIs
Internationalization 2008-06-02
NumberInput_IMKit_Sample (HTML) (DMG) (ZIP)
Illustrates an input method that uses the Mac OS X 10.5 InputMethodKit framework.
Internationalization 2008-03-17
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
CarbonCocoaCoreImageTab (HTML) (DMG) (ZIP)
Carbon-based application creates a Cocoa-based web window which used CoreImage filters to transition between tabbed WebViews
Internet & Web 2006-07-25
JavaFrameEmbedding example (HTML) (DMG) (ZIP)
Small Cocoa application that demonstrates how to use JavaFrameEmbedding.framework
Internet & Web 2007-06-12
JSInterpreter (HTML) (DMG) (ZIP)
Simple JavaScript interpreter
Internet & Web 2007-06-06
JSPong (HTML) (DMG) (ZIP)
Pong with JavaScript AI
Internet & Web 2007-06-06
LSMSmartCategorizer (HTML) (DMG) (ZIP)
Demonstrates the Latent Semantic Mapping (LSM) framework by automatically categorize RSS feeds.
Internet & Web 2007-05-09
NewsReader (HTML) (DMG) (ZIP)
Demonstrates use of the Publication Subscription framework to create a simple RSS reader application.
Internet & Web 2007-06-01
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.
Internet & Web 2008-02-28
SpecialPictureProtocol (HTML) (DMG) (ZIP)
Use a custom NSURLProtocol to create jpeg images in memory for display in a webView.
Internet & Web 2006-03-13
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
JavaFrameEmbedding example (HTML) (DMG) (ZIP)
Small Cocoa application that demonstrates how to use JavaFrameEmbedding.framework
Java 2007-06-12
JDragNDrop (HTML) (DMG) (ZIP)
Deprecated - Demonstrates building a simple view to implement Drag-and-Drop functionality in Cocoa-Java.
Java 2003-01-14
SimpleCocoaJavaMovie (HTML) (DMG) (ZIP)
Deprecated - A simple movie player showing how to use the NSMovieView and NSMovie Cocoa Java classes.
Java 2003-01-14
AutoUpdater (HTML) (DMG) (ZIP)
This sample demonstrates Cocoa networking using the NSURL loading classes, NSURLConnection and NSURLDownload.
Networking 2005-06-01
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
CocoaSOAP (HTML) (DMG) (ZIP)
Demonstrates implementing a SOAP client and server in Cocoa.
Networking 2005-06-06
GetMACAddressSample (HTML) (DMG) (ZIP)
Demonstrates how to retrieve the MAC address for each Ethernet interface from the Mac OS X I/O Registry.
Networking 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 2005-10-27
GridCalendar (HTML) (DMG) (ZIP)
Demonstrates how to add a custom job submission UI to the GridSample project.
Networking 2005-06-01
ImageClient (HTML) (DMG) (ZIP)
Demonstrates how to use CFNetwork for synchronous and asynchronous operations, network diagnostics, proxy navigation, and authentication.
Networking 2005-06-01
NameAndAddress (HTML) (DMG) (ZIP)
A single window utility that gets a host name from an IP address or an IP address from a hostname.
Networking 2003-01-14
NewsReader (HTML) (DMG) (ZIP)
Demonstrates use of the Publication Subscription framework to create a simple RSS reader application.
Networking 2007-06-01
PictureSharing (HTML) (DMG) (ZIP)
Demonstrates how to use NSNetServices to advertise a service using Bonjour.
Networking 2005-02-08
PictureSharingBrowser (HTML) (DMG) (ZIP)
Demonstrates how to use NSNetServices to take advantage of Bonjour service discovery and name resolution.
Networking 2005-02-08
PortMapper (HTML) (DMG) (ZIP)
Demonstrates Bonjour's NAT port-mapping API, and provides a higher-level Objective-C interface to it.
Networking 2008-07-25
TextLinks (HTML) (DMG) (ZIP)
Programmatically creates links to URLs and other objects and handles clicks in non-URL links.
Networking 2003-07-29
URL CacheInfo (HTML) (DMG) (ZIP)
Demonstrates resource caching behavior using the Cocoa URL loading system.
Networking 2008-06-05
AlbumToSlideshow (HTML) (DMG) (ZIP)
Demonstrates using CF and NSXML to create Final Cut Pro XML.
Objective-C Language 2008-05-15
Cocoa_With_Carbon_or_CPP (HTML) (DMG) (ZIP)
Shows how to call Carbon routines and C++ code from within an Objective-C Cocoa program.
Objective-C Language 2007-02-05
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
MethodReplacement (HTML) (DMG) (ZIP)
Demonstrates an Objective C 2 compatible way to replace a method in an existing Objective C class.
Objective-C Language 2006-08-01
Reminders (HTML) (DMG) (ZIP)
Dashboard widget with a plug-in that displays upcoming iCal events, to do items, and calendars.
Objective-C Language 2008-07-25
Squiggles (HTML) (DMG) (ZIP)
Demonstrates many Cocoa fundamentals in a Document-based Application featuring custom drawing and event-handling.
Objective-C Language 2008-08-29
DerivedProperty (HTML) (DMG) (ZIP)
Illustrates use of Core Data derived properties to make searching against string data more efficient.
Performance 2008-06-04
SharedMemory (HTML) (DMG) (ZIP)
Shows how multiple applications can access the same memory using the Unix shmget system call.
Performance 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.
Performance 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.
Performance 2003-01-14
URL CacheInfo (HTML) (DMG) (ZIP)
Demonstrates resource caching behavior using the Cocoa URL loading system.
Performance 2008-06-05
Worm (HTML) (DMG) (ZIP)
NSView performance demonstration. Uses a periodic timer to get best performance with Coalesced Update feature.
Performance 2005-06-01
CarbonQuartzComposer_TV (HTML) (DMG) (ZIP)
Demonstrates how to integrate Cocoa based QuartzComposer window into a Carbon based application
Porting 2006-10-02
Moriarity (HTML) (DMG) (ZIP)
Implementing a Cocoa GUI that wraps command-line functionality, calling a UNIX task and presenting the results in a GUI.
Porting 2003-01-14
PMPrinterTest (HTML) (DMG) (ZIP)
Demonstrates using the PMPrinter APIs to obtain information about the connected printers.
Printing 2009-02-13
ViewController (HTML) (DMG) (ZIP)
Demonstrates how to use "NSViewController".
Printing 2007-06-11
CrossEvents (HTML) (DMG) (ZIP)
Demonstrates how to send CarbonEvents and NSNotifications between Carbon and Cocoa.
Process Management 2007-05-31
LoginItemsAE (HTML) (DMG) (ZIP)
Uses Apple events to manipulate the list of login items (items launched when you log in).
Process Management 2005-10-17
NSOperationSample (HTML) (DMG) (ZIP)
Demonstrates how to use the NSOperation and NSOperationQueue classes.
Process Management 2007-06-11
PreLoginAgents (HTML) (DMG) (ZIP)
Pre-login launchd agents to display UI using AppKit and HIToolbox.
Process Management 2007-10-26
SharedMemory (HTML) (DMG) (ZIP)
Shows how multiple applications can access the same memory using the Unix shmget system call.
Process Management 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.
Process Management 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.
Process Management 2003-01-14
BackgroundExporter (HTML) (DMG) (ZIP)
Demonstrates techniques which can be used to export QuickTime movies in a separate export process.
QuickTime 2005-07-22
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
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
ExtractMovieAudioToAIFF (HTML) (DMG) (ZIP)
Demonstrates how to extract audio from QuickTime Movies and write the data to an AIFF file.
QuickTime 2006-03-31
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
ImagesToQTMovie (HTML) (DMG) (ZIP)
Creates a QuickTime movie from the images of any connected camera.
QuickTime 2003-01-14
LiveVideoMixer3 (HTML) (DMG) (ZIP)
LiveVideoMixer3 is extended to support Video In via QTKit
QuickTime 2006-08-01
Movie Overlay (HTML) (DMG) (ZIP)
Shows how to overlay text & graphics and perform animation on an QTMovieView through a floating overlay window.
QuickTime 2008-07-25
MyMovieFilter (HTML) (DMG) (ZIP)
How to play a movie into a layer-backed QTMovieView and apply a Core Image filter while the movie plays.
QuickTime 2008-06-02
OpenGLCompositorLab (HTML) (DMG) (ZIP)
Demonstrates using OpenGL to composite multiple sources in hardware. Requires NVIDIA GeForce 4 Ti hardware.
QuickTime 2003-04-21
QTAudioContextInsert (HTML) (DMG) (ZIP)
Demonstrates use of Audio Context Insert APIs to perform custom processing on QuickTime's audio stream.
QuickTime 2008-01-21
QTAudioExtractionPanel (HTML) (DMG) (ZIP)
Enhances the QTKitPlayer to add an Audio Channel Mapping and Extraction panel
QuickTime 2005-06-27
QTCompressionOptionsWindow (HTML) (DMG) (ZIP)
Demonstrates how easy it is to manage QTCompressionOptions instances with a user interface.
QuickTime 2008-02-22
QTCoreImage101 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using Core Image filters and the new video pipeline.
QuickTime 2005-07-19
QTCoreVideo101 (HTML) (DMG) (ZIP)
Demonstrates (with very little code) how to render a QuickTime Movie using CoreVideo and OpenGL.
QuickTime 2008-04-24
QTCoreVideo102 (HTML) (DMG) (ZIP)
An application demonstrating the use of QTKit, CoreVdeo, and OpenGL.
QuickTime 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.
QuickTime 2008-06-06
QTCoreVideo201 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using OpenGL FBO and the Core Video texture pipeline.
QuickTime 2008-06-06
QTCoreVideo202 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using OpenGL PBO and the Core Video pixel buffer pipeline.
QuickTime 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.
QuickTime 2009-04-07
QTEffectsDialog - Cocoa (HTML) (DMG) (ZIP)
Shows how to display the standard QuickTime effects parameters dialog in a Cocoa application.
QuickTime 2003-09-04
QTExtractAndConvertToAIFF (HTML) (DMG) (ZIP)
Demonstrates using MovieAudioExtraction and an AudioConverter to extract and convert audio to a AIFF file.
QuickTime 2006-11-08
QTExtractAndConvertToMovieFile (HTML) (DMG) (ZIP)
Demonstrates using MovieAudioExtraction and an AudioConverter to extract and convert audio to a QuickTime movie file.
QuickTime 2006-11-08
QTGraphicsImport (HTML) (DMG) (ZIP)
Demonstrates how to use the QuickTime Graphics Importer to draw an image into a NSWindow using a NSQuickDrawView.
QuickTime 2003-01-14
QTKitButtonTester (HTML) (DMG) (ZIP)
Shows how to use the QTMovieView methods for hiding and showing the buttons in the movie controller bar.
QuickTime 2006-08-01
QTKitMovieShuffler (HTML) (DMG) (ZIP)
Demonstrates a simple QTKit movie player application.
QuickTime 2006-01-03
QTKitPlayer (HTML) (DMG) (ZIP)
QTKit example code to open, edit, play, import and export QuickTime movies
QuickTime 2007-08-31
QTKitThreadedExport (HTML) (DMG) (ZIP)
Shows how to export a QTMovie on a background thread.
QuickTime 2006-08-01
QTKitThreadsExporter (HTML) (DMG) (ZIP)
Demonstrates QTKit threading APIs by performing concurrent exports on separate threads.
QuickTime 2007-10-08
QTKitTimeCode (HTML) (DMG) (ZIP)
Demonstrates how to use the QuickTime 32-bit Timecode Media Handler to Add and Remove Timecode Tracks.
QuickTime 2007-09-19
QTNoStepsDemo (HTML) (DMG) (ZIP)
Shows how to subclass QTMovieView to override its default behaviors.
QuickTime 2006-08-01
QTQuartzPlayer (HTML) (DMG) (ZIP)
QTQuartzPlayer demonstrates how to render QuickTime Movies and live video with OpenGL and CoreVideo.
QuickTime 2005-10-04
QTRecorder (HTML) (DMG) (ZIP)
Shows how to use the new QTKit capture classes introduced in 10.5.
QuickTime 2007-04-10
QTtoCG (HTML) (DMG) (ZIP)
Shows how to create a CGImageRef with the proper ColorSync profile from a QuickTime image on disk.
QuickTime 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
SimpleCocoaJavaMovie (HTML) (DMG) (ZIP)
Deprecated - A simple movie player showing how to use the NSMovieView and NSMovie Cocoa Java classes.
QuickTime 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
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
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