What thread do you work on "[NSThread exit]"? [NSThread output] runs on the current thread , so you need to call this as part of the myfunction selector. If you call it in the main thread, it will just exit the main thread.
In addition, it is not recommended to stop such streams, as this prevents the stream from exiting from cleaning resources.
myfunction .
- (void) myFunction
{
while([someObject stillWorkToBeDone])
{
performBitsOfWork();
}
}
, "withObject". , , .
, smth, :
[someObject setStillWorkToBeDone:false]