iOS系统库导致内存泄漏

时间:2018-10-14 03:12:32

标签: memory-leaks uikit

我正处于应用程序错误修复和优化的最后阶段。我正在调试应用程序中的泄漏。现在只有导致泄漏UIKitCore的系统库。有什么可以做的吗?

enter image description here

enter image description here

那个奇怪的uikeyboardpredictionview导致怀疑是main函数中的泄漏

我的main函数非常简单

import UIKit
import RxSwift

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    var service: MovieService!
    let disposeBag = DisposeBag()

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.

        let service = MovieService(provider: TMDBprovider)

        let tabBarController = window?.rootViewController as! UITabBarController

        let popularMovieNavi = tabBarController.viewControllers?.first as! UINavigationController
        let popularMovieVC = popularMovieNavi.viewControllers.first as! PopularMovieVC
        popularMovieVC.viewModel = PopularMovieViewModel(service: service)

        let searchMovieNavi = tabBarController.viewControllers?.last as! UINavigationController
        let searchMovieVC = searchMovieNavi.viewControllers.first as! SearchMovieVC
        searchMovieVC.viewModel = SearchMovieViewModel(service: service)

        return true
    }

b是否可以解决该错误?

0 个答案:

没有答案