The Foundation framework provides many services through a small set
of classes that allow developers to interact with the underlying
operating system in several ways.
NSTask is an
object-oriented interface to configure and launch a process as a
the current application.
lets an application discover information
about its current process.
Example 2-35 shows some of the information you can
obtain by using
// Get the shared process info object for the current processNSProcessInfo *proc = [NSProcessInfo processInfo];
// The name and PID of the processNSString *name = [proc processName]; int pid = [proc processIdentifier];
// The arguments launched with the processNSArray *args = [proc arguments];
// A dictionary of the environment variables for the processNSDictionary *env = [proc environment];
// The host name for the host running the processNSString *host = [proc hostName];
// The operating system version string
// Note: this string is NOT appropriate for parsingNSString *ver = [proc operatingSystemVersionString];
is a class that lets a
program configure, launch, and communicate with another program as a
subprocess. This is something you’ll see every time
you execute an application you work on from within Project Builder.
NSTask is launched in a fully configurable execution environment where environment variables, command line options, and other ...