【发布时间】:2014-09-23 01:44:26
【问题描述】:
是否可以得到NSUserDefaults的总大小?因为我知道它将所有内容保存在.plist 文件中。找到那个文件然后看看它有多大应该不会太难。
【问题讨论】:
-
此
.plist文件存在于cache文件夹中。 -
plist 文件位于
AppDirectory/Library/Preferences/<BundleIdentifier>.plist下。尝试阅读attributes of this file。 -
@Amar 是 iphone/iphone 模拟器中的那个文件夹吗?
-
它是您在设备/模拟器上安装它时创建的应用程序目录。在模拟器上,这个路径是
/Users/<username>/Library/Application Support/iPhone Simulator/<iOS version>/Applications/3FC9264F-371B-4DFC-8714-2726E45B0D6F/Library/Preferences -
您不应该对
AppDirectory路径进行硬编码...需要以编程方式执行并附加剩余路径,包括 plist 文件名和扩展名。 stackoverflow.com/a/3763050/1407017
标签: ios nsuserdefaults