问题
Screenshot
UIImagePickerController
was working very well on iOS 9.2, with a memory usage of 19m in my iPhone.
Since iOS 9.3, I noticed that the memory usage is increasing to 300m and the application crashes.
my code:
import UIKit
import MobileCoreServices
class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
func pick(){
let imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
imagePicker.mediaTypes = [String(kUTTypeImage)]
imagePicker.allowsEditing = false
self.presentViewController(imagePicker, animated: true, completion: nil)
}
func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage, editingInfo: [String : AnyObject]?) {
}
@IBAction func touched(sender: AnyObject) {
pick()
}
}
来源:https://stackoverflow.com/questions/36183117/ios-9-3-uiimagepickercontroller-memory-issue