Re: Simple iOS App with Foundation InputStream and OutputStream...


 



On Nov 15, 2017, at 9:48 AM, Brandon Peters <bap04e@...> wrote:

Thanks for reply. I thought the +[NSStream getStreamsToHostWithName:…] was deprecated in iOS 11+?

Just take a look at the header. It’s only the older version that takes an NSHost that’s deprecated:

@interface NSStream (NSSocketStreamCreationExtensions)

+ (void)getStreamsToHostWithName:(NSString *)hostname port:(NSInteger)port inputStream:(NSInputStream * _Nullable * _Nullable)inputStream outputStream:(NSOutputStream * _Nullable * _Nullable)outputStream API_AVAILABLE(macos(10.10), ios(8.0), tvos(9.0)) __WATCHOS_PROHIBITED;

#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE))
+ (void)getStreamsToHost:(NSHost *)host port:(NSInteger)port inputStream:(NSInputStream * _Nullable * _Nullable)inputStream outputStream:(NSOutputStream * _Nullable * _Nullable)outputStream API_DEPRECATED("Please use getStreamsToHostWithName:port:inputStream:outputStream: instead", macos(10.3,10.10)) API_UNAVAILABLE(ios, watchos, tvos);
#endif

@end

Join cocoa@apple-dev.groups.io to automatically receive all group messages.