Chapter 21. Pasteboards and Nil-Targeted Actions

A process called the pasteboard server (/usr/bin/pboard) runs on your Mac. Applications use the NSPasteboard class to write data into that process and to read data from that process. The pasteboard server makes possible such operations as copying, cutting, and pasting between applications.

An application can copy the same data onto the pasteboard in several formats. For example, an image can be copied onto the pasteboard as a PDF document and as a PNG image. Then the application that reads the data can choose the format that it likes most. The pasteboard uses UTIs to identify the various types used on the pasteboard.

Prior to Mac OS X 10.6, the pasteboard APIs allowed for only one item on the pasteboard ...

Get Cocoa® Programming for Mac® OS X, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.