gpt4 book ai didi

ios - 将 MP3 添加到应用程序主包而不更新

转载 作者:行者123 更新时间:2023-11-29 01:46:45 25 4
gpt4 key购买 nike

我有一个用 Swift 编写的应用程序,类似于音板。目前我的应用程序主包中只有一堆 mp3。是否可以远程将更多 mp3 添加到应用程序主包中,然后更改代码中的变量以适应新的 mp3?我想要它,这样我就可以动态添加新的 mp3,而无需经历整个应用程序审核过程。理想情况下,用户第二天打开应用程序会发现已添加 15 个新 mp3,而无需下载更新。有这种可能吗?

最佳答案

You can’t write to the main bundle on iOS. Its contents are cryptographically signed as a part of the App Store submission process; modifying its contents would prevent the application from running.

引用自THIS回答。

您可以从这篇文章中获得更多信息:File write with [NSBundle mainBundle] fails .

File System Programming Guide :

  • /AppName.app

    This is the bundle directory containing the app itself. Do not write anything to this directory. To prevent tampering, the bundle directory is signed at installation time. Writing to this directory changes the signature and prevents your app from launching again.


  • /Documents/

    Use this directory to store critical user documents and app data files. Critical data is any data that cannot be recreated by your app, such as user-generated content. The contents of this directory can be made available to the user through file sharing. The contents of this directory are backed up by iTunes.


  • /Library/

    This directory is the top-level directory for files that are not user data files. You typically put files in one of several standard subdirectories but you can also create custom subdirectories for files you want backed up but not exposed to the user. You should not use this directory for user data files. The contents of this directory (with the exception of the Caches subdirectory) are backed up by iTunes. For additional information about the Library directory, see “The Library Directory Stores App-Specific Files.”


您可以阅读 THIS如果你想将文件写入文档目录。

希望这会有所帮助。

关于ios - 将 MP3 添加到应用程序主包而不更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31826851/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com