我在 Swift 中遇到了这个错误“编译器无法在合理的时间内对该表达式进行类型检查;尝试将表达式分解为不同的子表达式”
这是引发错误的代码。
let obj = self.AddressList[indexPath.row] as! Address
// let a:String! = obj.street+" ,"+obj.city+" "+obj.country
// let b:String! = obj.country
StaticData.singleton.cardAddress = obj.street+" ,"+obj.city+" "+obj.country
StaticData.singleton.AddressID = obj.id
StaticData.singleton.cart_addresstotal = obj.total_amount
StaticData.singleton.cart_addressFee = obj.delivery_fee
DispatchQueue.main.async {
self.dismiss(animated:true, completion:nil)
}
特别是错误指向的代码的这一部分:
StaticData.singleton.cardAddress = obj.street+" ,"+obj.city+" "+obj.country