Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/118.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/swift/18.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 从URL创建CGPDFDocument会在Swift 3中产生错误吗?_Ios_Swift_Core Graphics_Swift3 - Fatal编程技术网

Ios 从URL创建CGPDFDocument会在Swift 3中产生错误吗?

Ios 从URL创建CGPDFDocument会在Swift 3中产生错误吗?,ios,swift,core-graphics,swift3,Ios,Swift,Core Graphics,Swift3,当我尝试构建时,下面的代码块会产生这两个错误。有人能帮我吗?Xcode 8在我的项目中使用了它的migrator,我以前没有看到过这个错误 let url = URL(string: "http://www.google.com")!; var pdf:CGPDFDocument = CGPDFDocument(url); 错误:无法使用类型为“(URL)”的参数列表调用类型为“CGPDFDocument”的初始值设定项 注意:“CGPDFDocument”的重载存在于这些部分

当我尝试构建时,下面的代码块会产生这两个错误。有人能帮我吗?Xcode 8在我的项目中使用了它的migrator,我以前没有看到过这个错误

    let url = URL(string: "http://www.google.com")!;
    var pdf:CGPDFDocument = CGPDFDocument(url);
  • 错误:无法使用类型为“(URL)”的参数列表调用类型为“CGPDFDocument”的初始值设定项
  • 注意:“CGPDFDocument”的重载存在于这些部分匹配的参数列表中:(CGDataProvider),(CFURL)

  • 你好,下面应该是这样的

    let url = URL(string: "http://www.google.com")!
    fileprivate var pdfDoc: CGPDFDocument
    pdfDoc = CGPDFDocument(url as CFURL)!