Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

newformac

macrumors regular
Original poster
May 24, 2011
107
0
hi all,

i am using NSTask and some times waitUntilExit not return and application become unresponsive so please tell me is there any other function that can i use in place of waitUntilExit

or

any other method to prevent my application unresponsive and check if there is something wrong return with some error value or else.

please give suggestions for this.

thanks.
 
What programs are you running with NSTask? Be specific.

Are any of them producing standard output streams? Are any of them reading their standard input streams? If they are, and you don't read the output or give them the input, then the program may wait forever, which would cause the exact symptom you see.


There are C functions that do things similar to NSTask, but you still have to know how the sub-programs you run work. That is, you can get wait-forever from the C functions, too, if you don't know what you're doing.

The C function system() is one such function. The popen() function is another. Read their man pages to see how they work.
 
how to improve the error handling in the python code for timeout error, or how to change the Objective-C code handle python hang on problem.
 
What have you tried?

You haven't explained exactly what causes the problem. Which port? Which other parameters?

You haven't explained what level of programming skill you have, or what you're learning from.

If you don't know how to program well enough to even try solving this problem, then you need to go back to learn the fundamentals. You can't program effectively just by copying and pasting code you find on the internet.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.