使用.strings文件的iOS本地化中的内存管理 [英] Memory management in iOS Localization with .strings file

查看:111
本文介绍了使用.strings文件的iOS本地化中的内存管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之前曾发布过这样的内容:应该是什么本地化iOS项目的更好方法?

Earlier i had posted this: What should be the better way for localizing iOS project?

现在我已经完成了这两种方法的项目,并且对那里给出的答案感到满意.

Now I have done projects for both the ways and I am satisfied with the answers given over there.

在.strings文件本地化中,如果存在用户名UILabel,则代替在.nib本身中分配值,我们确实为此创建了一个IBOutlet,并在.m文件中分配值.那么该IBOutlet是否消耗了额外的内存?

In .strings file localization, if there is a username UILabel then instead of assign values in .nib itself, we do create an IBOutlet for that and in .m file we are assigning values. So is there any extra memory consumed by that IBOutlet?

推荐答案

最好使用 IBOutlet 来访问 .m 文件,以修改外观.即使您使用retain声明它,它也不会给您带来额外的内存窃听,但这只会增加retainCount,但是如果您保留UILabel,请不要忘记在dealloc中释放它.

It's perfectly fine to have IBOutlet for accessing it .m file for the purpose of modifying the appearance. It will not give you any extra memory overheard, Even if you declare it with retain it will just increase the retainCount BUT don't forget to release it in dealloc if you retain the UILabel.

这篇关于使用.strings文件的iOS本地化中的内存管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆