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. Enter image details here

You need to import as MobileCoreServices as defined in kUTTypeImage MobileCoreServices as Go kUTTypeImage: CFString .

Therefore add 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

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -