Name

NSProcessInfo — Mac OS X 10.0

Synopsis

This class provides an way for applications to discover information about their current process and host. This information includes such things as the execution arguments, environment variables, process ID, and the process name. Using NSProcessInfo, clients may also discover information about the host, such as the host name, and the operating system name and version. NSProcessInfo returns the operating system version in a human-readable form that is unsuitable for parsing.

image with no caption

@interface NSProcessInfo : NSObject
                                  // Accessor Methods
   - (void)setProcessName:(NSString *)newName;
   - (NSString *)processName;
                                  // Class Methods
   + (NSProcessInfo *)processInfo;
                                  // Instance Methods
   - (NSDictionary *)environment;
   - (NSString *)globallyUniqueString;
   - (unsigned int)operatingSystem;
   - (NSString *)operatingSystemName;
   - (NSString *)operatingSystemVersionString;
   - (int)processIdentifier;
   - (NSArray *)arguments;
   - (NSString *)hostName;

Get Cocoa in a Nutshell 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.