仪器显示内存泄漏-Xcode 9.4和模拟器iPhoneX 11.4

时间:2018-08-03 06:53:31

标签: ios xcode instruments

在对我的应用程序进行内存泄漏分析时,仪器会在以下代码中显示泄漏-

let viewController = (UIStoryboard.init(name: "Main", bundle: nil)).instantiateViewController(withIdentifier: "HistoryView") as! HistoryViewController

这是我使用此代码的方法-

@objc func historyButtonAction(sender : UIButton)
    {
        let viewController = (UIStoryboard.init(name: "Main", bundle: nil)).instantiateViewController(withIdentifier: "HistoryView") as! HistoryViewController
        viewController.account = self.account;
        self.navigationController?.pushViewController(viewController, animated: true);
    }

无法解决此泄漏。希望能对您有所帮助。

0 个答案:

没有答案