NSTask
The NSTask object is used to create and control new processes. When the process ends, the object will post an NSTaskDidTerminateNotification notification. Before creating (or launching) the new process, you will set the attributes of the new process with these methods:
- (void)setLaunchPath: (NSString *)path
Sets the path to the code that will be executed when the process is created.
- (void)setArguments: (NSArray *)arguments
Takes an array of strings that will be the arguments to the program.
- (void)setEnvironment: (NSDictionary *)dict
You can use this to set the environment variables. If unset, the environment ...
Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide 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.