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?
NSTaggedPointerString is about the dynamic type of the object. Your issue is about the type you have written in your source code. – Catfish_Man. Apr 6, 2016 at 17:16. 1.
A static, plain-text Unicode string object that bridges to String ; use NSString when you need reference semantics or other Foundation-specific behavior.
NSTaggedPointerString is already an NSString, it's just a subclass. You can use it anywhere you can use an NSString, without conversion.
I have encountered places where NSTaggedPointerString cannot be used as a NSString, such as when creating an NSDictionary. In those cases use stringWithString::
NSString* <# myNSString #> = [NSString stringWithString:<# myNSTaggegedString #>];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With