UIDocumentInteractionController presentOpenInMenuFromRect

时间:2015-07-03 07:45:38

标签: ios xcode swift uidocumentinteraction

我有从UIAlertController中调用的代码:

func createSomeFile() {

    var output = (some NSData to output to file)


    let fileName = NSTemporaryDirectory().stringByAppendingPathComponent("filename.ext")
    let url: NSURL! = NSURL(fileURLWithPath: fileName)

    var dataToWrite = output.dataUsingEncoding(NSUTF8StringEncoding)
    dataToWrite?.writeToFile(url.absoluteString!, atomically: true)

    documentController = UIDocumentInteractionController(URL: url)
    documentController.UTI = "com.someUTI"
    documentController.delegate = self

    documentController.presentOpenInMenuFromRect(CGRectZero, inView: self, animated: true)
}

最后一行在Xcode中引发错误:“无法使用类型为...的参数列表调用'presentOpenInMenuFromRect'”

documentController被声明为类变量 var documentController = UIDocumentInteractionController()

请帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

您无法将class Demo { private $runafterupdate; ... public function up() { Schema::connection('exitproducts')->create('exitcontrol_carmanager_manager', function($table) { $table->engine = 'InnoDB'; $table->increments('id'); $table->string('code'); $this->runafterupdate['code'] = true; $table->timestamps(); }); } if(isset($this->runafterupdate['code'])) { echo "it worked!"; } } ... } 分配给应为self的参数(除非UIViewself的子类,但显然不是)

所以试试这个:

UIView