gpt4 book ai didi

swift - 视频未保存在解析中

转载 作者:行者123 更新时间:2023-11-30 13:49:03 26 4
gpt4 key购买 nike

输出显示:

- Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.
- Save successful

但是当我进入解析后端时,没有任何内容被保存。

@IBAction func recordAction(sender: AnyObject) {

    if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera){
print("Camera Available")

let imagePicker = UIImagePickerController()

imagePicker.delegate = self
imagePicker.sourceType = .Camera
imagePicker.mediaTypes = [kUTTypeMovie as String]
imagePicker.videoMaximumDuration = 180 // Perhaps reduce 180 to 120
imagePicker.videoQuality = UIImagePickerControllerQualityType.TypeMedium
imagePicker.allowsEditing = false

imagePicker.showsCameraControls = true

self.presentViewController(imagePicker, animated: true, completion: nil)
}
else {
print("Camera Unavailable")
}
}

func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {

let Video = PFObject(className:"Video")
Video["user"] = PFUser.currentUser()

let tempImage = info[UIImagePickerControllerMediaURL] as! NSURL!
_ = tempImage.relativePath

let videoData = NSData(contentsOfFile:tempImage.relativePath!)

let videoFile:PFFile = PFFile(name:"consent.mp4", data:videoData!)!
Video["videoFile"] = videoFile
self.dismissViewControllerAnimated(true, completion: nil)
videoFile.saveInBackgroundWithBlock({ (succeeded: Bool, error: NSError?) -> Void in
// Handle success or failure here ...
if succeeded {
print("Save successful")
} else {
print("Save unsuccessful: \(error?.userInfo)")
}

}, progressBlock: { (amountDone: Int32) -> Void in

})
}

最佳答案

我明白了。我的数据库中有一个额外的列,但在应用程序代码中没有说明。当我删除它时,数据发送成功。

关于swift - 视频未保存在解析中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34552158/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com