需要完整的数据保护,而核心数据处理在后台 [英] Need complete Data protection while Core Data processing is in background

查看:189
本文介绍了需要完整的数据保护,而核心数据处理在后台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的目标是保护我的数据


$ b

我经历了Nickharris博客(核心数据和企业iPhone应用程序 - 保护您的数据



但在结论中,如果您的应用程序在任何后台处理中需要您的核心数据存储,则不能使用数据保护。任何尝试访问 NSFileProtectionComplete的文件都会导致异常



我在后台处理中使用核心数据。



请帮助这个。



感谢,
Tariq

解决方案

根据文档 NSFileProtectionComplete指示在应用程序处于后台(或未运行)时无法读取或写入文件。



在应用程序运行时可以读/写SQLite存储,但是当它处于后台时你将无法访问它。



这意味着利用iOS背景API的操作:




  • 推送通知

  • 背景音频/ li>
  • 任务完成(背景)

  • 语音IP



将无法访问您的SQLite存储。当应用程序运行时,您应该能够像通常情况下访问NSPersistentStoreCoordinator。我怀疑设备端测试将导致无法从其中一个后台API创建持久存储协调器。


I am just stuck in the middle of the project.

My objective is to protect my data.

I have gone through Nickharris blog regarding (Core Data and Enterprise iPhone Applications – Protecting Your Data)

But in the conclusion it is clearly mentioned that:

If your application needs your Core Data store in any background processing, then you cannot use data protection. Any attempt to access files that are NSFileProtectionComplete will cause an exception.

And I am using core data in background processing.

Please help regarding this. I want to encrypt and protect my data anyhow

Thanks, Tariq

解决方案

According to the documentation NSFileProtectionComplete dictates that the file cannot be read from or written to while the application is in the background (or not running).

You should be fine to read / write the SQLite store while the application is running, however you will not have access to it while it is in the "background".

This means that operations which leverage the iOS background APIs like:

  • Push notifications
  • Background Audio / Location
  • Task completion (Background)
  • Voice Over IP

Will not have access to your SQLite store. When the app is running however you should be able to access the NSPersistentStoreCoordinator as you normally would. I suspect that a device side test would result in a failure to create the persistent store coordinator from one of the background APIs.

这篇关于需要完整的数据保护,而核心数据处理在后台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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