gpt4 book ai didi

swift - 无法加载从带有标识符的包中的 Nib 引用的 “” 图像

转载 作者:行者123 更新时间:2023-11-30 11:21:13 25 4
gpt4 key购买 nike

当我将图像放入playingwithcontainerviews文件夹中时,它们会显示在我的应用程序上。当我将图像放入 imagesofcuteanimals 文件夹时,它们没有。我已为该文件夹选择了目标。这是错误:无法加载从带有标识符的包中的 Nib 引用的“”图像。

image of where the pictures of cute animals are located

最佳答案

蓝色文件夹是引用类型,当您加载图像时访问它,如下

let img = UIImage(named:"folderName/imageName.jpeg")

if let img = Bundle.main.path(forResource:"imageName",ofType:"jpeg",
inDirectory:"folderName") { }

关于swift - 无法加载从带有标识符的包中的 Nib 引用的 “” 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51252313/

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