iOS - обнаружение утечек и их понимание - PullRequest
0 голосов
/ 02 мая 2019

Итак. я могу видеть в инструментах -> инструмент утечек и в графе отладочной памяти, что у меня есть утечки. Я пытаюсь понять, почему происходит утечка, да нет успеха.

Это утечки:

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

Как вы можете видеть, большинство утечек указывают на один и тот же код. Например:

 let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath as IndexPath) as! ChooseCameraCell

И все же я могу понять, что не так с этой строкой кода. Еще один:

  self.presentViewController(vc: Constants.NavigationVc.NAVIGATION_CONTROLLER)

func presentViewController(vc: String) {
    let storyboard = self.storyboard
    let controller = storyboard?.instantiateViewController(withIdentifier: vc)        
    let appDelegate = UIApplication.shared.delegate as! AppDelegate
    appDelegate.window?.rootViewController = controller
}

, а также:

 self.viewController.view.frame = CGRect(x: 0,y: 0, width: self.view.frame.width,height: self.view.frame.height)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...