NSTask not running properly when compiled

HI i have coded an App for Mac OSX that has embedded a Command line tool, the problem is that everything works fine while i am running from the xcode compiler, after build the final product, the app is not working properly and i can see messages like this in the console.

Task <AFD7D7BC-6851-461D-86C1-54CD7734FBE3>.<251932> not allowed to create a new connection (existing Connection 224)

Task <37752B7F-5827-4160-83C4-773B17AE72DF>.<255990> resuming, timeouts(60.0, 604800.0) QOS(0x21) Voucher (null)

i was reading a link posted here but the solution is not working, some ideas are appreciated.

My guess is that maybe is something related with a security setting.

This is the code:


    NSTask *task;

    NSString *executableName = @"websocat";
    NSString *executablePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:executableName];

    task = [[NSTask alloc] init];
    [task setLaunchPath:executablePath];
    



Quinn “The Eskimo!" please help!

Replies

Is the containing app sandboxed?

ps Using NSTask correctly is trickier than you might think. I have some specific advice in Running a Child Process with Standard Input and Output. You might want to keep that in mind going forwards, but the issues it resolves are unlikely to be the cause of your current problem.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • Hi Eskimo, i tried with sandbox and without sandbox, i will check your link, thanks

Add a Comment

mmmmh, if the program is running ok inside the Xcode and is not outside, maybe is something related with Build settings, any clue?