내 코드는 imagePickerView를 제공하는 버튼이 포함 된 스토리 보드에서 만든보기가있는 간단한 클래스입니다. imagePickerView 제시 도착 후 응용 프로그램이 잘못 어디로, 어떤 도움이 좋지 않을까 알아낼 수 없습니다 libc++abi.dylib: terminating with uncaught exception of type NSException
현재 ImagePickerView가 충돌을 일으킴
import Foundation
import UIKit
class ImageSelectionView: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
override func viewDidLoad(){
super.viewDidLoad()
}
@IBAction func backButtonTapped(_ sender: AnyObject) {
self.navigationController?.dismiss(animated: true, completion: nil)
}
@IBAction func openPhotoLibrary(_ sender: AnyObject) {
if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.photoLibrary) {
let imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = UIImagePickerControllerSourceType.photoLibrary;
imagePicker.allowsEditing = true
present(imagePicker, animated: true, completion: nil)
self.present(imagePicker, animated: true, completion: nil)
}
}
func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) {
self.dismiss(animated: true, completion: nil);
}
}
와 충돌, 감사합니다!
사진에 대한 허가를 요청 했습니까? – neprocker
@MikeG 내 대답을 시도하고 알려주세요 작동 여부는 요? –
내 대답을 확인하십시오. –