O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Challenge: An Even Better Scattered

Adapt Scattered to use the proper solution outlined in the previous section. Because NSImage avoids doing disk I/O until absolutely necessary, you will need to read the data in manually and then create the image using that data. NSData will read the image data. Check the documentation or header file for NSImage to find a way to create an image from an NSData object.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required