Ok, I have this code for this program that creates symbolic links. When the create symbolic link button is pressed this code is executed:
Then an alert pops up and when the OK button is return and I terminate the NSTask.
Using this:
But when I press the button a second time I get this error:
Which is weird because the NSTask should not be running.
Code:
[symLinkTask setArguments:[NSArray arrayWithObjects:@"-s", sourcePath, targetPath, nil]];
[symLinkTask launch];
[symLinkTask waitUntilExit];
Then an alert pops up and when the OK button is return and I terminate the NSTask.
Using this:
Code:
[symLinkTask terminate];
But when I press the button a second time I get this error:
Code:
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'task already launched'
Which is weird because the NSTask should not be running.