ios 9.3 UIImagePickerController memory issue
Asked Answered
T

0

2

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()  
    }  
}  
Tonl answered 23/3, 2016 at 16:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.