O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

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

NSWorkspace

Back in the mists of time, the original NeXT-system UI was called the Workspace. These days it’s a combination of the Finder and the Dock. Cocoa’s NSWorkspace class provides features that were originally available in the NeXT workspace. NSWorkspace, actually, is a combination of Finder features as well as being a higher level API on top of Apple’s Launch Services. Launch Services is a database of applications, file types, icons, and associated data.

Because the system has one Launch Services database and the user has one Finder, you interact with NSWorkspace via a shared instance:

+ (NSWorkspace *) sharedWorkspace;

You can open files and URLs, and launch applications as if you had double-clicked them in the Finder. NSWorkspace

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