I need to realize a communication between two threads using NSPipe channels, the problem is that I don't need to call terminal command by specifying this methods.
[task setCurrentDirectoryPath:@"....."];
[task setArguments:];
I just need to write some data
NSString * message = @"Hello World";
[stdinHandle writeData:[message dataUsingEncoding:NSUTF8StringEncoding]];
and on the other thread to receive this message
NSData *stdOutData = [reader availableData];
NSString * message = [NSString stringWithUTF8String:[stdOutData bytes]]; //My Hello World
For example such things in C# can be easy done with NamedPipeClientStream, NamedPipeServerStream classes where pipes are registered by id string.
How to achieve it in Objective-C?