Trying to create an app that does some socket communication (Writing only).
I can get it to work with a static value:
UInt8 buf[] = "play"; int bytesWritten = CFWriteStreamWrite(writeStream, buf, strlen((char*)buf));
I'm a relative neophyte to C/Objective-C and I'm trying to figure out how to pass an NSString to a function and get the value into "buf".
-(void) sendData: (NSString *) command {
UInt8 buf[] = ????;
int bytesWritten = CFWriteStreamWrite(writeStream, buf, strlen((char*)buf));
}
Obviously more to it than that...just isolating the relevant code.