0
为什么这个Square示例直接针对他们的README不起作用?无法用类型为'(_)'的参数列表调用'perform'
let callbackURL = URL(string: "OdinMobile://")!
do {
let amount = try SCCMoney(amountCents: money, currencyCode: "USD")
let request : SCCAPIRequest =
try SCCAPIRequest(
callbackURL: callbackURL,
amount: amount,
userInfoString: userInfoString,
merchantID: nil,
notes: notes,
customerID: nil,
supportedTenderTypes: supportedTenderTypes,
clearsDefaultFees: clearsDefaultFees,
returnAutomaticallyAfterPayment: true
)
} catch let error as NSError {
print(error.localizedDescription)
}
do {
try SCCAPIConnection.perform(request)
} catch let error as NSError {
print(error.localizedDescription)
}
我得到一个Cannot invoke 'perform' with an argument list of type '(_)'
与Overloads for 'perform' exist with these partially matching parameter lists: (SCCAPIRequest), (Selector!)
的附加消息。我想让request
成为SCCAPIRequest,为什么它不能作为一个阅读?是因为它在do
区块吗?
我想,我应该自己试过。 –
@NilsGuillermin请一定要接受这个答案,当你有机会...感谢队友! –