0

I use the code below to retrieve a text data from the server in requestDidFinished method:

  NSString *responseString = [request responseString];
  NSDictionary *responseDict = [responseString JSONValue];
  if (responseDict != Nil) {            
      self.dataArray = [responseDict allValues];
      NSLog(@"data Array: %@",self.dataArray);
}

Log:

    data Array: (
    "Welcome To Let’s Drive"
)

Now i need to know to to put the log message in textView and how to let the word "Let's" appear properly not "Let’s"

Bobj-C
  • 5,276
  • 9
  • 47
  • 83

2 Answers2

0

You should run the string through an HTML character decoder to get rid of the HTML entities.

Check out this question for more details on how to do it: HTML character decoding in Objective-C / Cocoa Touch

Community
  • 1
  • 1
Kristofer Sommestad
  • 3,061
  • 27
  • 39
0

You have a string encoding problem, what does responseString come out as in an NSLog? You could specify the encoding by creating a string with response data

- (id)initWithData:(NSData *)data encoding:(NSStringEncoding)encoding

something like

NSString *responseString = [[NSString alloc] initWithData:[request responseData] encoding:NSUTF8StringEncoding];

or whatever the expected encoding is.

jbat100
  • 16,757
  • 4
  • 45
  • 70