1. <legend id='sZ3JC'><style id='sZ3JC'><dir id='sZ3JC'><q id='sZ3JC'></q></dir></style></legend>
      <tfoot id='sZ3JC'></tfoot>

      <small id='sZ3JC'></small><noframes id='sZ3JC'>

    1. <i id='sZ3JC'><tr id='sZ3JC'><dt id='sZ3JC'><q id='sZ3JC'><span id='sZ3JC'><b id='sZ3JC'><form id='sZ3JC'><ins id='sZ3JC'></ins><ul id='sZ3JC'></ul><sub id='sZ3JC'></sub></form><legend id='sZ3JC'></legend><bdo id='sZ3JC'><pre id='sZ3JC'><center id='sZ3JC'></center></pre></bdo></b><th id='sZ3JC'></th></span></q></dt></tr></i><div id='sZ3JC'><tfoot id='sZ3JC'></tfoot><dl id='sZ3JC'><fieldset id='sZ3JC'></fieldset></dl></div>
        <bdo id='sZ3JC'></bdo><ul id='sZ3JC'></ul>

      为 UIImagePicker 设置委托返回错误

      Setting delegate for UIImagePicker returns error(为 UIImagePicker 设置委托返回错误)

        • <tfoot id='cQhMX'></tfoot>

                <tbody id='cQhMX'></tbody>

              <small id='cQhMX'></small><noframes id='cQhMX'>

                <bdo id='cQhMX'></bdo><ul id='cQhMX'></ul>

              • <i id='cQhMX'><tr id='cQhMX'><dt id='cQhMX'><q id='cQhMX'><span id='cQhMX'><b id='cQhMX'><form id='cQhMX'><ins id='cQhMX'></ins><ul id='cQhMX'></ul><sub id='cQhMX'></sub></form><legend id='cQhMX'></legend><bdo id='cQhMX'><pre id='cQhMX'><center id='cQhMX'></center></pre></bdo></b><th id='cQhMX'></th></span></q></dt></tr></i><div id='cQhMX'><tfoot id='cQhMX'></tfoot><dl id='cQhMX'><fieldset id='cQhMX'></fieldset></dl></div>
                <legend id='cQhMX'><style id='cQhMX'><dir id='cQhMX'><q id='cQhMX'></q></dir></style></legend>
                本文介绍了为 UIImagePicker 设置委托返回错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我为 OCR 翻译应用程序编写的一些快速代码存在问题.代码片段如下:

                Having a problem in some swift code I had written for an OCR translation app. The code snippet is below:

                @IBAction func btnOCR(sender: AnyObject) {
                
                    var languageAlert = UIAlertController(title: "For Your Information...", message: "The OCR feature currently only supports English & French.", preferredStyle: .Alert)
                    languageAlert.addAction(UIAlertAction(title: "Okay", style: .Default, handler: { action in
                
                        var image = UIImagePickerController()
                        image.sourceType = UIImagePickerControllerSourceType.Camera
                        image.allowsEditing = false
                        image.delegate = self
                        presentViewController(image, animated: true, completion: nil)
                
                    }))
                    self.presentViewController(languageAlert, animated: true, completion: nil)
                }
                

                image.delegate = self 行返回错误:Cannot assign a value of viewcontroller to uiimagepickerdelegate.

                The image.delegate = self line returns the error: Cannot assign a value of type viewcontroller to uiimagepickerdelegate.

                我已经在类定义中设置了委托,如下图...

                I have set the delegate in the class definition, this can be seen below...

                class ViewController: UIViewController, UITextFieldDelegate, UIPickerViewDelegate, UIPickerViewDataSource, UIImagePickerControllerDelegate {    }
                

                我们将不胜感激,提前致谢.

                All and any help would be appreciated, thanks in advance.

                推荐答案

                你忘记了你的 ViewController 类定义中的 UINavigationControllerDelegate.

                You forgot about UINavigationControllerDelegate in your ViewController class defenition.

                图像选择器的委托对象.

                The image picker’s delegate object.

                声明

                unowned(unsafe) var delegate: protocol<UIImagePickerControllerDelegate, UINavigationControllerDelegate>?
                

                这篇关于为 UIImagePicker 设置委托返回错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                iOS AutoLayout - get frame size width(iOS AutoLayout - 获取帧大小宽度)
                Auto layout constraints issue on iOS7 in UITableViewCell(UITableViewCell中iOS7上的自动布局约束问题)
                How to resize superview to fit all subviews with autolayout?(如何调整超级视图的大小以适应所有具有自动布局的子视图?)
                Springs in Auto Layout: Distribute views evenly, with constraints, in Xcode 5(自动布局中的弹簧:在 Xcode 5 中使用约束均匀分布视图)
                reloadData() of UITableView with Dynamic cell heights causes jumpy scrolling(具有动态单元格高度的 UITableView 的 reloadData() 导致跳跃滚动)
                What is NSLayoutConstraint quot;UIView-Encapsulated-Layout-Heightquot; and how should I go about forcing it to recalculate cleanly?(什么是 NSLayoutConstraint“UIView-Encapsulated-Layout-Height?我应该如何强制它干净地重新计算?) - IT屋-程序员
                  <bdo id='P0Jja'></bdo><ul id='P0Jja'></ul>

                        <small id='P0Jja'></small><noframes id='P0Jja'>

                        <i id='P0Jja'><tr id='P0Jja'><dt id='P0Jja'><q id='P0Jja'><span id='P0Jja'><b id='P0Jja'><form id='P0Jja'><ins id='P0Jja'></ins><ul id='P0Jja'></ul><sub id='P0Jja'></sub></form><legend id='P0Jja'></legend><bdo id='P0Jja'><pre id='P0Jja'><center id='P0Jja'></center></pre></bdo></b><th id='P0Jja'></th></span></q></dt></tr></i><div id='P0Jja'><tfoot id='P0Jja'></tfoot><dl id='P0Jja'><fieldset id='P0Jja'></fieldset></dl></div>
                      • <tfoot id='P0Jja'></tfoot>
                        <legend id='P0Jja'><style id='P0Jja'><dir id='P0Jja'><q id='P0Jja'></q></dir></style></legend>

                            <tbody id='P0Jja'></tbody>