ios - UIImagePickerController and fatal error: array element cannot be bridged to Objective-C -
I'm making UIImagePickerController to take a picture like this though, in this statement, / P>
cameraUI.mediaTypes = [kUTTypeImage] This shows an error like this:
Fatal error: array element Can not be built in Objective-C
How do I do? I'm now using Xcode 6 Beta version 4.
presentCamera function () {cameraUI = UIImagePickerController () cameraUI.delegate = self cameraUI.sourceType = UIImagePickerControllerSourceType.Camera cameraUI.mediaTypes = [kUTTypeImage] cameraUI .allowsEditing = false self.presentViewController (cameraUI, Animated: true, perfection: zero)} Edit - I have such an error.
You need to import Therefore add as MobileCoreServices as defined in kUTTypeImage MobileCoreServices as Go kUTTypeImage: CFString . -> MobileCoreServices and import MobileCoreServices to your .swift file. Go to link libraries -> + -> MobileCoreServices.framework Import to
and your .swift file.
Edit : As kUTTypeImage is optional, then change your line in this gift
cameraUI.mediaTypes = [! KUTTypeImage]
Comments
Post a Comment