August 2011
Intermediate to advanced
552 pages
23h 48m
English
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
Read now
Unlock full access