0

Actually I have an UDPServer app, where i get an ip address as NSData from UDPClient app as response. But i can not convert this into NSString.Please help.

Swapnil Patil
  • 969
  • 2
  • 18
  • 40
  • 1
    What encoding is the data in? There is no seamless way to convert data into string unless you know the exact format to expect – Stavash Oct 10 '13 at 07:15
  • http://stackoverflow.com/questions/2467844/convert-utf-8-encoded-nsdata-to-nsstring ? – Larme Oct 10 '13 at 07:15

1 Answers1

1
 //data is your data in NSData format
 NSString *ConvertedSting=[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
 NSLog(@"Converted String: %@", ConvertedSting);
Tapas Pal
  • 6,877
  • 6
  • 37
  • 82