The following code was working fine until I upgraded to OSX Lion. It called an external command and saved the output into a NSString.
I have no idea why it stopped working. Any ideas?
-(NSString *) rawResponse{
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/usr/sbin/scselect"];
NSPipe *pipe = [NSPipe pipe];
[task setStandardError:pipe];
[task launch];
NSData *data = [[pipe fileHandleForReading] readDataToEndOfFile];
[task waitUntilExit];
[task release];
NSString *result = [[[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding] autorelease];
NSLog(@"The returned value is: %@", result);
return result;
}