I’m working on NSTask and Pipe, in particularly on the script at page 215 of Shane Stanley’s book.
I copied the whole script and inserted the call of the method inside a button:
on buttonClicked:sender
doShellScriptInBackgroud:theScript callback:"dataIsReady:"
end buttonClicked:
By pressing the button I get this error:
2014-09-29 16:35:48.696 Test[604:303] *** -[AppDelegate doShellScriptInBackgroud:callback:]: unrecognized selector sent to object <AppDelegate @0x60000003cc80: OSAID(9) ComponentInstance(0x810000)>
2014-09-29 16:35:48.700 Test[604:303] *** -[AppDelegate buttonClicked:]: *** -[AppDelegate doShellScriptInBackgroud:callback:]: unrecognized selector sent to object <AppDelegate @0x60000003cc80: OSAID(9) ComponentInstance(0x810000)> (error -10000)
Any help?
But I have a further question: how can I get live output but the NSNotificationCenter, i.e. how can I get the exact single line of the output of the shell script?
And how can I do that? Because as it is now, it just gives an output when the task is finished, so I get lines of output in once, and it’s not what I need…