Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

arme

macrumors member
Original poster
Sep 15, 2008
48
0
NSString *tmp = [[NSString alloc] initWithData:receivedData encoding:UTF8Char];

Error before encoding .
 
I receive a request from url. that is a string( OK or NOK) .it is save in NSSMUutableData . i need convert to NSString. have are you a idea?
 
I know what you are trying to do. You've posted about it over and over and over and over and over and over and over and....

You say "Error before encoding". What is the error. Unless you are willing to post questions with enough detail you are not going to get answers.
 
error message is syntax error before encoding.
and the remind of code is correct.
please give me an idea that solve converting?
thanks
 
error message is syntax error before encoding.

Then you have typed something incorrectly somewhere. Not necessarily on that line: you may have forgotten a ; or a ] somewhere else.

In my own code I'm using this (not sure why I chose this method over that one):

Code:
NSString *sourceSt = [[NSString alloc] initWithBytes:[downloadedData bytes] length:[downloadedData length] encoding:NSUTF8StringEncoding];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.