ios 9.3 UIImagePickerController memory issue

三世轮回 提交于 2019-12-22 17:20:52

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!