I made an application which uses NSStream
to etablish a connection to a telnet server.
When the connection is made, I send a first command. Then I use sleep(1);
to make my application wait. Then the second command is sent.
The problem is that the entire GUI is stuck during the sleep()
. I know that it's not the "perfect" way to make a "pause" and I'd like to learn how to this properly. I heard good things about NSTimer
but I'd like to have a concrete and "easy" way of using it, to simply replace my poor use of sleep()
.