ios - 如果我们在 React Native 中打开控制中心,应用程序会在 iOS 中崩溃
问题描述
我们正在做 React Native 应用程序。它在 iOS 和 Android 上都运行良好。但是,启动应用程序后,如果我们打开控制中心,应用程序就会崩溃。
控制台数据如下
Error: {
message = "Entries must be arrays of the form [key: string, value: string], got: (\n InActiveTime\n)";
}
有什么建议吗?
解决方案
最后,我找到了问题所在。
问题是我们在 Asyncstorage 中存储了一些键值,我们在那里存储了日期。该日期数据类型无法存储在 Asyncstorage 中。因此,据我了解,我们可以仅存储 Asyncstorage字符串类型。
希望这对将来的人有所帮助。
AsyncStorage.setItem(time, new Date().toString());
推荐阅读
- java - 如何转换流
流式传输 ? - vim - 使用自动命令 BufNewFile 时未加载 Vim 颜色方案
- parsing - 如何在解释器中处理赋值和变量语法
- nginx - 如何阻止 NGINX 网络服务器中的特定 URL
- asp.net - My.Log.WriteEntry 可以写入应用程序日志以外的内容(asp.net 4.5)
- powerbi - PowerBi 中的总工作日计算
- git - 分支实际上是否等于它们在 git 中的最后一次提交?
- javascript - 循环遍历多维数组并选择项目
- php - 如何使用 php 创建圆形图像?
- algorithm - 就内存而言,二叉搜索树与哈希表