PDA

View Full Version : NSTask environment variables




ajbrehm
Apr 7, 2007, 06:12 PM
How can I set the environment variables for an NSTask?

I want the task to be able to see DISPLAY to connect to an X server.



robbieduncan
Apr 7, 2007, 06:26 PM
Did you even read the documentation (http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSTask_Class/Reference/Reference.html#//apple_ref/occ/instm/NSTask/setEnvironment:) before asking? Obviously you might want to read the current environment (http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSTask_Class/Reference/Reference.html#//apple_ref/occ/instm/NSTask/environment) and add the variable you want to that dictionary to set...