Core Data的最大存储容量是多少? [英] What is maximum storage capacity of Core Data?

查看:136
本文介绍了Core Data的最大存储容量是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. Core Data的最大存储容量是多少?

  2. 在应用程序级别定义了任何容量限制?喜欢,在可用的核心数据空间,我的应用程序可以只消耗X金额?

  3. 如果我的应用程式尝试超越X,该怎么办?


解决方案>

Core Data没有硬盘存储容量,所以你几乎受到系统可用磁盘空间的限制。在iOS上(大部分时间在OS X上)核心数据由SQLite支持,因此如果有任何限制,它的大小是支持SQLite数据库的大小。未保存的数据存储在RAM中,iOS不支持分页内存,因此未保存的数据集受设备上可用的RAM限制。如果你试图超过RAM,你的应用程序将被关闭。如果你试图超过磁盘空间,我想保存操作将失败,并有一个适当的NSError。


  1. What is the maximum storage capacity of Core Data?
  2. Is there any capacity limit defined at the app level? Like, out of total available Core Data space, my app can consume only X amount?
  3. What if my app tries to exceed the X?

解决方案

Core Data has no hard storage capacity, so you're pretty much just limited by the available disk space on the system. On iOS (and most of the time on OS X) Core Data is backed by SQLite, so if there's any restriction, it's in the size of the backing SQLite database. Unsaved data is stored in RAM, and iOS does not support paging out memory, so your unsaved data set is limited by the available RAM on the device. If you try to exceed the RAM, your app will be shut down. If you try to exceed disk space, I imagine the save action will fail with an appropriate NSError.

这篇关于Core Data的最大存储容量是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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