Replacing escape characters in NSData

Discussion in 'Mac Programming' started by donaghy, Aug 25, 2009.

  1. donaghy macrumors member

    Joined:
    Aug 6, 2009
    #1
    Hi all, I'm reading the response of NSURLConnection into a NSData object. However the xml is not being created correctly, the characters < and > are being replace with < and &gt. How can i replace this characters in the NSData object with the correct characters?

    cheers.
     
  2. donaghy thread starter macrumors member

    Joined:
    Aug 6, 2009
    #2
    Ok i've got a working fix. I converted the NSData to a NSMutableString and called my method for replacing the characters, setting NSMutableString to the new correct data format. I then converted NSMutableString to NSData and then parsed.

    I dont particularly like the way i've done it, it doesnt seem fool proof to me so if anyone can point out a better method it would be appreciated.
     

Share This Page