Instance member cannot be used on type of custom class

前端 未结 3 1371
耶瑟儿~
耶瑟儿~ 2020-11-28 00:06

I have a classe named \"whisky builder\" which only initiates the new Whisky. Now i would like to add the new added whiskies in my \"WhiskyOverViewController\". But I face t

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-28 00:35

    The two types must be incompatible with each other. Just like you cannot assign a UIImage to a String, your program won't let you assign a [WhiskyBuilder] array type to a WhiskyOverViewController type. You must have declared stringArray globally, because otherwise Swift would infer its type.

提交回复
热议问题