convert NSTaggedPointerString to NSString

Henry Zhang picture Henry Zhang · Oct 19, 2015 · Viewed 31.6k times · Source

I had called an interface of Baidu to check id Number, however the value of Sex returned with sex = M, without "" around the M in JSON, when I use NSString in module to store it and then print the class name of this sex property, it printed as NSTaggedPointerString, I doubt how to convert it to a String to use it. Anyone have good ideas?

Answer

Catfish_Man picture Catfish_Man · Oct 19, 2015

NSTaggedPointerString is already an NSString, it's just a subclass. You can use it anywhere you can use an NSString, without conversion.