由于Swift 2即时通讯

无法使用参数为类型SKproductsRequest调用初始化程序
类型(productIdentifiers:Set)

对于我的NSSet中的应用内购买标识符

ios - 无法为参数类型为(productIdentifiers:Set <NSObject>)的SKproductsRequest类型调用初始化程序-LMLPHP

if(SKPaymentQueue.canMakePayments()) {

        let productID:NSSet = NSSet(objects:
            "com.someurl.monthlyAutoRenewable",
            "com.someurl.annualAutoRenewable")

        let request: SKProductsRequest = SKProductsRequest(productIdentifiers: productID as Set<NSObject>)
        request.delegate = self
        request.start()
    }
    else {


    }

最佳答案

更换
let request: SKProductsRequest = SKProductsRequest(productIdentifiers: productID as Set<NSObject>)

let request: SKProductsRequest = SKProductsRequest(productIdentifiers: productID as! Set<String>)
修复它

09-26 04:17