
self.myProp = @"some value";//string literal?self.myProp = [Nsstring stringWithString:@"some value"];
这里有区别吗?
第一个字符串文字是不是自动释放的,还是只是在内存中它的当前范围,我不必担心它?
总结Such an object is created at compile time and exists throughout your program’s execution. The compiler makes such object constants unique on a per-module basis,and they’re never deallocated,though you can retain and release them as you do any other object.
以上是内存溢出为你收集整理的cocoa – 字符串或带字符串的nsstring全部内容,希望文章能够帮你解决cocoa – 字符串或带字符串的nsstring所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)