我正在使用Xcode 10.2.1和macOS Catalina Developer Beta2。每当我尝试使用Memory Graph调试器时,都会出现此错误:
内存图调试器:未从LeakAgent接收到序列化的内存图
之后,加载微调器将无限期旋转。
我已经尝试过在此相关问题下推荐的答案,但不幸的是,这些方法都无效。我试图重新安装该应用程序;重新启动Xcode,iOS Simulator和我的计算机;删除了DerivedData文件夹,并尝试了其他模拟器-这些都不起作用。
在我的项目中当我开始在内存图调试器中寻找泄漏时,我发现很少并修复了它们,现在使用内存图没有发现泄漏。Instruments->leaks 的问题,有时显示泄漏,有时不显示,泄漏立即从照片中描述的开始出现,我几乎不明白导致泄漏的原因。如果内存图显示没有泄漏,我可以相信吗?或者存在一种内存图未捕获的泄漏。代码如何初始化 mainViewController:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
self.window = UIWindow()
let controller = MainViewController()
let navigationController = UINavigationController(rootViewController: controller)
let rootViewController = navigationController
self.window?.rootViewController = rootViewController
self.window?.makeKeyAndVisible()
return true
}
Run Code Online (Sandbox Code Playgroud) memory-leaks ios xcode-instruments swift memory-graph-debugger