Since the third parameter of CFStreamCreatePairWithSocketToCFHost
is of type SInt32
, all you need is to change the signature of your getStreamsToHostNamed
method as follows:
+ (void)getStreamsToHostNamed:(NSString *)hostName
port:(SInt32)port
inputStream:(NSInputStream **)inputStream
outputStream:(NSOutputStream **)outputStream
In general, you should avoid implicit conversions between NS wrappers of integer types, because these have platform-dependent implementations. Fortunately, compiler issues warnings about this, so you don't have to track them down manually.