Tuesday, September 27, 2022
HomeiOS Developmentios - UIImage produces reminiscence leaks

ios – UIImage produces reminiscence leaks

[ad_1]

Setting a picture in a UIImageView produces reminiscence leaks.
I attempted to do it in 3 ways and all of them produce reminiscence leaks.

@IBOutlet weak var imageCategory: UIImageView!

 func firstTry() {
 let url = Bundle.primary.url(forResource: "biceps", withExtension: "png")
 let imageData = strive! Information(contentsOf: url!)
 myImage.picture = UIImage(knowledge: imageData)
 }

func secondTry() {
 myImage.picture = UIImage(named: biceps)
}

func thirdTry() {
 let path = Bundle.primary.path(forResource: "biceps", ofType: nil)
 myImage.picture = UIImage(contentsOfFile: path!)
}

There are reminiscence leaks

enter image description here

[ad_2]

RELATED ARTICLES

Most Popular

Recent Comments