- (void)connection:(NSString*)serviceName forIpAddress:(NSString *)ipAddress
forPort:(NSString *)portNo
{
if(inputStream && outputStream)
//[self close];
NSString *urlString = [NSString stringWithFormat:@"http://%@",ipAddress];
NSURL *website = [NSURL URLWithString:urlString];
if (!website) {
NSLog(@"%@ is not a valid URL", website);
}
CFReadStreamRef readStream;
CFWriteStreamRef writeStream;
CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)[website host], [portNo
intValue], &readStream, &writeStream);
CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket,
kCFBooleanTrue);
CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket,
kCFBooleanTrue);
inputStream = (NSInputStream *)readStream;
outputStream = (NSOutputStream *)writeStream;
[self open];
}
Getting ARC errors at NNString, NSInputStream,NSoutputStream. Error says..Cast of c pointer type CFreadStreamRef to c pointer type NSinput stream needs bridging cast.