Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.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/variables/2.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
尝试在iOS8上与Swift一起使用PaymentKit_Swift_Stripe Payments - Fatal编程技术网

尝试在iOS8上与Swift一起使用PaymentKit

尝试在iOS8上与Swift一起使用PaymentKit,swift,stripe-payments,Swift,Stripe Payments,全部, 我已经使用Swift for Apple Pay将PaymentKit添加到iOS8项目中。 我还添加了一个桥接头,如下所示: #import "Stripe.h" #import "PTKView.h" 我已为支付工具包创建了一个新的view controller swift文件,如下所示: import UIKit class PaymentViewController: UIViewController { override func viewDidLoad() {

全部,

我已经使用Swift for Apple Pay将PaymentKit添加到iOS8项目中。 我还添加了一个桥接头,如下所示:

#import "Stripe.h"
#import "PTKView.h"
我已为支付工具包创建了一个新的view controller swift文件,如下所示:

import UIKit

class PaymentViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}
我测试了这个应用程序,它在PTKView上出现了错误。。
有什么想法吗

如果我用File->Add files->PaymentKit文件夹添加了支付工具包SDK,它就工作了。如果我直接添加它,它就不工作了

在声明之前未导入Foundation。您可以通过预处理PTKView.m并记录排序来看到这一点

有两个简单的解决方法选择:

<添加1 @进口基金会;在声明之前或
2在报头导入

之后移动声明行,您需要包括基础框架。