Currently I am able to write and receive data containing a String by doing this:
NSString *anyString = @"anyString";
NSData *data = [anyString dataUsingEncoding:NSUTF8StringEncoding];
[self.outputStream write:[data bytes] maxLength:[data length]];
But is it possible to put an object in the data and write it to the outputStream? If so, how? If it's not possible, should I just pass a unique identifier(NSString) through the socket and compare with my list of objects until I find a matching?
Thanks in advance.