What is the different between NSCFString and NSConstantString?

前端 未结 4 578
迷失自我
迷失自我 2020-12-17 18:19

I declare the object variable as a NSString But when I use the XCode to look into my object, I saw there are two type of String, it seems that the system automa

4条回答
  •  旧时难觅i
    2020-12-17 19:00

    As far as I know, NSCFConstantString is an implementation of NSString that keeps the string data in code memory. Compiler creates instances of it when you use @"string" constants. You can use NSCFConstantString anywhere an NSString could be used due to subclass/superclass relationship, but obviously not the other way around.

提交回复
热议问题