2012-02-01 3 views
2

App Store에 앱을 제출하는 데 문제가 있습니다. 이것은 업데이트 할 수있는 데이터베이스가 iCloud 백업 제한에 비해 너무 큽니다. DB에있는 대부분의 데이터는 정적이지만 한 테이블은 단어 검토를위한 사용자의 일정을 기록합니다 (이것은 어휘 퀴즈입니다).iOS - iCloud 백업 규칙을 준수하도록 데이터베이스를 구성하는 방법

제가 알 수있는 한, 두세 가지 옵션이 있습니다. 첫 번째 방법은 전체 데이터베이스를 Library/Cache 디렉토리에 저장하는 것입니다. 이는 iCloud에 백업되지 않았기 때문에 받아 들여야합니다.

http://developer.apple.com/library/IOs/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/PerformanceTuning/PerformanceTuning.html

Files Saved During App Updates 
When a user downloads an app update, iTunes installs the update in a new app directory. It then moves the user’s data files from the old installation over to the new app directory before deleting the old installation. Files in the following directories are guaranteed to be preserved during the update process: 

<Application_Home>/Documents 
<Application_Home>/Library 
Although files in other user directories may also be moved over, you should not rely on them being present after an update. 

두 번째 옵션으로 데이터를 입력하는 것입니다 그러나,이 URL에서 "앱 백업을보다 효율적으로"이 항목 당, 앱 업데이트가 동안 유지 될 것이라는 보장은 없다 NSDocuments 또는 NSLibrary 디렉토리에 skipBackupFlag로 표시합니다. 그러나 "iCloud 및 iTunes로 파일을 백업하지 못하도록하려면 어떻게해야합니까?"에서이 항목에 따라 iOS 5.0 및 이전 버전에서이 플래그가 작동하지 않는 것이 하나의 문제입니다.

https://developer.apple.com/library/ios/#qa/qa1719/_index.html

Important The new "do not back up" attribute will only be used by iOS 5.0.1 or later. On iOS 5.0 and earlier, applications will need to store their data in <Application_Home>/Library/Caches to avoid having it backed up. Since this attribute is ignored on older systems, you will need to insure your app complies with the iOS Data Storage Guidelines on all versions of iOS that your application supports 

에서이 내가 "skipBackupFlag"를 사용하는 경우에도, 난 여전히 데이터베이스를 클라우드에 백업지고하는 문제를해야한다는 것을 의미, 나는 생각한다.

그래서 세 번째 옵션은 데이터베이스를 두 개로 분할하는 것입니다. 업데이트 할 수있는 부분을 NSLibrary 또는 NSDocuments 디렉토리에두고 나머지는 응용 프로그램 자원으로 남겨 둡니다. 이렇게하면 크고 작은 부분을 클라우드에 저장하고 나머지는 앱 리소스 디렉토리에 남겨 둡니다. 문제는 이것이 좋은 이유가 없으므로 db를 분할하고 한 번에 두 개의 데이터베이스를 열어서 가능한 성능 문제를 야기한다는 것입니다.

내 질문은 규칙에 대한 나의 해석이 맞습니까? 3 번 옵션으로 가야 하나?

p.s. 나는 나의 마지막 포스트에서 url이 URL을 보여주는 링크없이 편집되었다고 언급했다. 어떻게해야합니까?

+0

두 번째 옵션에 대해 - 기본적으로 저장소 가이드에서 말하는 것처럼 skipBackupFlag가 5.0.1 이후에만 사용 가능하다는 사실을 확인 프로세스에 문제가 있다고 생각하지 않습니다 ... – Shtong

+0

좋습니다, 그런데 어떻게 그걸 보게 될까요? "iOS 5.0 및 이전 버전에서는 응용 프로그램을 백업하지 않으려면 /Library/Caches에 데이터를 저장해야합니다." 아마도 iCloud에 백업 될 것입니다. –

+0

5.0.1의 '백업하지 않음'속성을 설정할 수 있다는 것을 확인한 사람이 있습니까? 5.0 앱은 여전히 ​​iCloud에 백업되지만 Apple은 앱을 승인합니까? – FishStix

답변

0

https://developer.apple.com/library/IOS/#releasenotes/DataManagement/RN-CoreData/_index.html에 설명 된 외부 파일 참조를 사용 해본 적이 있습니까? 자세한 내용은 "setAllowsExternalBinaryDataStorage :"https://developer.apple.com/library/IOS/documentation/Cocoa/Reference/CoreDataFramework/Classes/NSAttributeDescription_Class/reference.html#//apple_ref/occ/instm/NSAttributeDescription/setAllowsExternalBinaryDataStorage :을 참조하십시오. 대용량 데이터를 별도의 파일로 푸시하면 데이터베이스 크기를 줄일 수 있습니다.

+0

그러나 CoreData 외부 저장소의 데이터가 iCloud와 어떤 식 으로든 동기화되고 있지 않습니까? 외부 저장소에 사용자 이미지를 저장하고 iCloud에 동기화됩니다. CoreData 외부 저장소는 sqlite 성능을 향상시키기 위해 sqlite 저장소 내에 많은 양의 데이터를 저장하지 않도록 사용됩니다. –

+0

@KostiantynSokolinskyi 좋은 지적. Jack이 제안한 Option3을 구현하는 방법을 제안했습니다. – rajagp

관련 문제