Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在应用扩展和容器应用之间共享一个 SQLite 数据库。数据库从(容器应用程序的)主包复制到应用程序组。扩展从该数据库副本读取和写入。问题是,如果在容器应用程序之前打开扩展程序,则没有可读取的数据库。我能做些什么?
您可以根据应用程序组在 NSUserDefaults 中放置一个标志,表明该应用程序已打开一次。然后扩展程序可以检查此“密钥”,如果缺少则显示合适的消息。
您究竟是如何将数据库复制到应用程序组的?