- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个用 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 :
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.
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.
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/
我是一名优秀的程序员,十分优秀!