Apps must follow the iOS Data Storage Guidelines or they will be rejected

前端 未结 7 1692
栀梦
栀梦 2021-02-04 21:40

i have developed an app that can download mp3 files (nearly 6 to 8 mb of size) from online and stored in NSDocumentDirectory. my app get rejected today and says that

         


        
7条回答
  •  甜味超标
    2021-02-04 22:02

    Apple wants to reduce the size of your backup footprint.

    First, stop using Documents. It's not appropriate.

    If you are able to download the files again reasonably easy, you should store them in a place they won't be backed up. I suggest Caches. If they're purged, you should just download them again.

    If it is difficult to download them again, you should store them somewhere else in the Library folder.

    You can find the Caches directory using:

    NSArray *paths = NSSearchPathForDirectoriesInDomains(
                            NSCachesDirectory, NSUserDomainMask, YES);
    

    Basically, this is what you have now, but instead of NSDocumentDirectory you use NSCachesDirectory.

    If you control the filenames, this is fine as is. If you don't, you should probably create a subdirectory and work from there so you don't collide with anything.

提交回复
热议问题