ios - NSOSStatusErrorDomain Code=-54 "操作无法完成。" 设置备用应用程序图标时
问题描述
在我的 iOS 项目中,我尝试为我的 iOS 应用程序设置备用图标,并且图像文件(icon_1、icon_2、icon_3)在我的项目包中,而不是在 Assets.xcassets 中。Info.list 像这样:
<key>CFBundleIcons</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>icon_1</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon_1</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
<key>icon_2</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon_2</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
<key>icon_3</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon_3</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon</string>
</array>
</dict>
</dict>
我将备用图标设置为源代码
[[UIApplication sharedApplication] setAlternateIconName:@"icon_1" completionHandler:^(NSError *error) {}
但是,图标不会更改并出现错误
Error Domain=NSOSStatusErrorDomain Code=-54 "The operation couldn’t be completed."
我该如何解决这个问题?
谢谢 :)。
解决方案
推荐阅读
- pandas - 计算非空列的数量并选择非空列 - python
- flutter - 颤振小部件打开时隐藏在键盘后面
- google-bigquery - Javascript chartAt 不是 UDF$1(STRING) 的函数
- firebase - 尝试从 Firebase 模拟器访问 GCP 存储时 JWT 无效
- laravel-lighthouse - 强制用户在 Laravel Lighthouse 中具有特定的 belongsTo 关系的最佳实践
- excel - EXCEL删除自定义表格样式不起作用
- java - LinkedList 实现中的 toString() 方法存在问题。爪哇
- c# - CTRL+C 中断处理程序后控制台中缺少字符
- python - 无法弄清楚为什么数组中的值不会配对?
- databricks - 为什么 Databricks 只绘制 1000 行?