Challenge: Write Multiple Representations

You are putting the string onto the pasteboard. Create the PDF for the view and put that on the pasteboard, too. Now you will be able to copy the image of the die into graphics programs. Test it using Preview’s New from Clipboard menu item. (Do not break the string’s copy and paste: Put both the string and the PDF onto the pasteboard.) Hint: You will need to create an NSPasteboardItem.

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.