tags:

views:

92

answers:

0

I just started getting into XCode and Co. What I am trying is to send accelerometer data via WLAN to a PC or Mac over a socket connection. I am trying at the moment with the iPhone simulator, on the other site a netbook with a Java program shall receive a test string for starters. Unfortunately my socket will not initialize. What am I doing wrong?

NSString *recStr = @"192.168.0.5";     //String with receiver IP
NSHost *hoster = [NSHost hostWithName:recStr]; //create a host
NSOutputStream *sendData; //create an output stream
[NSStream getStreamsToHost:hoster port:8000 inputStream:nil outputStream:&sendData];
[sendData retain];
[sendData setDelegate:self];
[sendData open];

A warning says NSStream may not respond to '+getStreamsToHost:inputSream:outputStream:'

So I guess parameters are wrong. But why and how to do it right? The program starts but I don't think I can send anything as long as this warning shows up (have not tried though).