作者:楼下地小黑 | 来源:互联网 | 2023-10-12 13:21
ImgettinganerrorasTypeofexpressionisambiguouswithoutmorecontext我收到一个错误,因为“没有更多上下文,表达
I'm getting an error as "Type of expression is ambiguous without more context"
我收到一个错误,因为“没有更多上下文,表达的类型是模糊的”
Here is my code
这是我的代码
@IBOutlet var customerDashboardButtons:[NSArray]?
var predicate = NSPredicate(format: "SELF.tag == %d", tag)
var filteredButtOns= customerDashboardButtons!.filter { predicate.evaluateWithObject($0) };
if 0
I have tried the following,
我试过以下,
var button:UIButton = customerDashboardButtons!.first //Error "NSArray? is not convertible to UIButton"
var button = customerDashboardButtons!.first as UIButton //Error "NSArray? is not convertible to UIButton"
Any help on this is appreciated.
对此有任何帮助表示赞赏。
2 个解决方案