在iOS应用程序中,主包和文档目录之间有什么区别? [英] In iOS apps , what's the difference between the main bundle and the documents directory?

查看:139
本文介绍了在iOS应用程序中,主包和文档目录之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以向我解释一下吗?

Can someone please explain it to me?

我想知道他们之间的区别如下:

I want to know the difference between them regarding things like:


  • 从设备获取的空间量(应用程序处于活动状态或终止状态)。

  • 内存使用情况。

  • 读取和写入数据的能力(在用户端)。

  • 当应用程序处于以下状态时,什么停留以及删除(或更改)的内容:已更新为Appstore /已删除。

  • The amount of space taken from the device (wether the the app is active or terminated).
  • Memory usage.
  • The ability to read and write data (on the user's end).
  • What stays and what gets removed (or changed) when the app is: Updated form the Appstore/ Deleted.

以及您可能需要的任何其他详细信息。

And any other details you may find necessary.

推荐答案

mainBundle是已安装的应用程序




  • 它是提取的ipa的大小(你可以在xcode事先)

  • 它是ReadOnly并且不包含用户文件(例如文档)

  • 已删除您的应用程序(它是应用程序)

  • 从App Store更新时,较旧的ioses会替换整个捆绑包,将其作为一个整体下载。较新的6+ IIRC,做增量更新,只下载更改的文件。你不能说下载了多少 - 至少是你改变的字节数。

  • the mainBundle is the installed app

    • it is the size of the extracted ipa (you can see that in xcode beforehand)
    • it is ReadOnly and won't contain user files (e.g. documents)
    • deleted with your app (it is the app)
    • when updating from the App Store, older ioses replace the whole bundle, downloading it as a whole. newer oses 6+ IIRC, do delta updates, only downloading changed files. you can't say how much is downloaded -- at least the amount of bytes you changed.

      • 其大小取决于您的用户/您的应用创建的文档;)以0 mb开头

      • 使用您的应用程序删除了ReadWrite


      • 保持不受更新影响

      • Its size depends on what your user/your app creates as documents ;) it starts with 0 mb
      • It is ReadWrite
      • deleted with your app
      • remains untouched by updates

      回答问题1和3和4

      问题2是错误的..文件系统文件夹不消耗内存,除非文件由app / os加载

      question 2 is wrong .. a filesystem folder doesn't consume memory unless files are loaded by the app/the os


      • os显然加载了必要的您应用的部分内容和所需的框架

      • 您的应用可以加载文档。

      内存使用情况只是模糊/与文件大小无关

      memory usage is only vaguely / not really related to file size

      这篇关于在iOS应用程序中,主包和文档目录之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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