快照未呈现的视图会导致空快照。警告信息

时间:2016-03-31 11:44:21

标签: ios swift uiimagepickercontroller

在我的情况下,我有两个使用相机的应用程序。直到现在一切都还好。由于在两个应用程序中几天(我已将设备更新到9.3并将Xcode更新为7.3),我收到警告"快照未渲染的视图会导致空白快照。" 为了确切地说我的应用程序仍然正常工作,我可以拍照但会出现警告信息。 下面我把我用来捕捉图片的示例代码。 有人能告诉我它是代码问题还是xcode / ios bug? 以及它对appStore submision进程的影响。

import UIKit

class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {

@IBOutlet weak var imageView: UIImageView!

@IBAction func cameraButton(sender: AnyObject) {

    if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera) {
        let imagePicker = UIImagePickerController()
        imagePicker.delegate = self
        imagePicker.sourceType = UIImagePickerControllerSourceType.Camera;
        imagePicker.allowsEditing = false
        self.presentViewController(imagePicker, animated: true, completion: nil)
    }
}

override func viewDidLoad() {
    super.viewDidLoad()
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
}


func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) {
    imageView.image = image
    self.dismissViewControllerAnimated(true, completion: nil);
}


func imagePickerControllerDidCancel(picker: UIImagePickerController) {
    self.dismissViewControllerAnimated(true, completion: nil)
}

}

1 个答案:

答案 0 :(得分:0)

如果你的示例代码是准确的,那么这看起来像UIKit内部漏洞给我的iOS错误/警告。您的代码中没有明确快照视图的位置。