无法使用参数类型 (productIdentifiers:Set<NSObject>) 调用类型 SKproductsRequest 的初始值设定项

cannot invoke initializer for type SKproductsRequest with an argument type (productIdentifiers:Set<NSObject>)

自从 Swift 2 我得到

cannot invoke initializer for type SKproductsRequest with an argument type (productIdentifiers:Set)

对于我的 NSSet

中的应用内购买标识符

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>)

修复它