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

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

问题描述

  1. Core Data 的最大存储容量是多少?
  2. 是否在应用级别定义了任何容量限制?例如,在可用的核心数据空间总量中,我的应用程序只能消耗 X 量?
  3. 如果我的应用试图超过 X 怎么办?

推荐答案

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

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天全站免登陆