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.
Asked
Active
Viewed 547 times
0
-
1What 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 Answers
1
//data is your data in NSData format
NSString *ConvertedSting=[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"Converted String: %@", ConvertedSting);

Tapas Pal
- 7,073
- 8
- 39
- 86
-
i've tried this before. but it's not work for me. thanks for reply. – CrazyDeveloper Aug 12 '14 at 14:01