Thursday, July 7, 2022
HomeiOS Developmentios - UIImage produces reminiscence leaks

ios – UIImage produces reminiscence leaks


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.foremost.url(forResource: "biceps", withExtension: "png")
 let imageData = attempt! Information(contentsOf: url!)
 myImage.picture = UIImage(information: imageData)
 }

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

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

There are reminiscence leaks

enter image description here

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments