UDP接続からのデータをチェックするためにこの機能があります
- (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];
}
「hello」を送信しても「ok」メッセージが返されず、else にジャンプする{}
誰か助けてくれますか?ありがとう