i have this function in order to check coming data from a udp connection
- (void)socket:(GCDAsyncSocket *)sock didReadData:(NSData *)data withTag:(long)tag
{
NSString *response = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSString *hello = @"hello";
if(response == hello){
[self debugPrint:[NSString stringWithFormat:@"ok"]];
}
else{
[self debugPrint:[NSString stringWithFormat:@"Read: \n%@",response]];
}
[response release];
}
I send a "hello" but it never return the "ok" message, it jumps to the else{}
Can anyone help?thank you