Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 未解析的标识符-SKErrorPaymentCancelled_Ios_Xcode_Swift_Swift2_Storekit - Fatal编程技术网

Ios 未解析的标识符-SKErrorPaymentCancelled

Ios 未解析的标识符-SKErrorPaymentCancelled,ios,xcode,swift,swift2,storekit,Ios,Xcode,Swift,Swift2,Storekit,昨天,随着iOS 9.3和OSX 10.11.4(包括Swift 2.2)的发布,我更新到了最新版本的Xcode 7.3 当我构建我的应用程序时,我得到一个错误声明 使用未解析标识符“SKErrorPaymentCancelled”检查用户是否已取消付款。我没有对它做任何特殊的处理,只是记录它(如下所示) 我在Swift 2.2变更日志中找不到任何说明StoreKit中任何内容已更改的内容。这在我更新之前运行良好 是否还有其他人看到此问题?自iOS 9.3起,已从SDK中删除常量SKErrorP

昨天,随着iOS 9.3和OSX 10.11.4(包括Swift 2.2)的发布,我更新到了最新版本的Xcode 7.3

当我构建我的应用程序时,我得到一个错误声明
使用未解析标识符“SKErrorPaymentCancelled”
检查用户是否已取消付款。我没有对它做任何特殊的处理,只是记录它(如下所示)

我在Swift 2.2变更日志中找不到任何说明StoreKit中任何内容已更改的内容。这在我更新之前运行良好


是否还有其他人看到此问题?

自iOS 9.3起,已从SDK中删除常量
SKErrorPaymentCancelled
。相反,请使用枚举


有关更多信息,请参阅和我的规范问答帖子的页面。

是否有我遗漏的文档?他们是否将所有StoreKit错误常量都移动到SKErrorCode中?@mattdonders查看iOS 9.3 SDK的StoreKit更改日志:哦,谢谢,肯定错过了。接下来还有一个问题(如果你知道的话)。可以根据SKErrorCode检查事务的哪些属性?我以前的代码(从上面修复)是
transaction.error!。code==SKErrorCode.PaymentCancelled
但现在我得到了
无法将类型“SKErrorCode”的值转换为预期的参数类型“Int”
@Matttonders使用
.rawValue
从枚举中获取
Int
值。太棒了-非常感谢您的帮助。一旦时间过去,我们将接受。
private func failedTransaction(transaction: SKPaymentTransaction) {
    print("failedTransaction...")
    if transaction.error!.code == SKErrorPaymentCancelled {
        print("Transaction Cancelled: \(transaction.error!.localizedDescription)")
    }
    else {
        print("Transaction Error: \(transaction.error!.localizedDescription)")
    }
    SKPaymentQueue.defaultQueue().finishTransaction(transaction)
}