gpt4 book ai didi

ios - Swift 1.2 UICollectionViewController if 语句与 UICollectionViewCell Image

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

我试图在 cell.albumimage.image 旁边放置一个 if 语句,但它说无法分配“UIImage?”类型的值? “如果我写这段代码:    

if cell.AlbumImage.image = "1433499137_settings_ios7_ios_7.png"{
            
    }

如果我写这段代码,Xcode 会说

Cannot assign a value of type “UIImage?

我正在研究 UICollectionViewController。你能帮我吗?

最佳答案

您使用了错误的运算符赋值 (=),而不是等于 (==)。

关于ios - Swift 1.2 UICollectionViewController if 语句与 UICollectionViewCell Image,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31150188/

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