कुछ त्वरित कोड में समस्या होने के कारण मैंने ओसीआर अनुवाद ऐप के लिए लिखा था। कोड स्निपेट के नीचे है:UIImagePicker के लिए प्रतिनिधि सेट करना त्रुटि
@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 = आत्म लाइन त्रुटि देता है: uiimagepickerdelegate के प्रकार ViewController का मान निर्दिष्ट नहीं कर सकते।
मैं कक्षा परिभाषा प्रतिनिधि निर्धारित किया है, यह नीचे देखा जा सकता है ...
class ViewController: UIViewController, UITextFieldDelegate, UIPickerViewDelegate, UIPickerViewDataSource, UIImagePickerControllerDelegate { }
सभी और किसी भी मदद के लिए अग्रिम में की सराहना की जाएगी, धन्यवाद।
क्या एक बेवकूफ गलती है! हाहा मैं फिर से भूल नहीं होगा। मदद के लिए आपका बहुत बहुत धन्यवाद! –
इस उत्तर को सही और बंद करें विषय –
आपको बहुत धन्यवाद> मुझे पता है कि मुझे UINAVIGATIONCONTROLLERDELEGATE – coolcool1994