簡體   English   中英

移至Xcode 7 / Swift 2.0會使應用卡在啟動屏幕上

[英]Moving to Xcode 7/Swift 2.0 causes app to get stuck on launch screen

最近,由於我的應用程序無法在iOS 9(任何設備)上編譯,因此我移至Xcode 7和Swift 2.0,但是在iOS 8.xx上,它按預期運行。

我環顧了Xcode並試圖找到一些原因,但是我能發現的是,當Xcode停留在啟動屏幕上時,在Xcode調試器中按下“暫停”將告訴我該代碼在objc_msgSend CPU使用率也達到100%(在8.xx上僅使用〜10-20%)。

CPU使用率

應用卡住的線程

objc_msg發送代碼

沒有什么不尋常的。 在Xcode 6.4上一切正常。 我將所有代碼遷移到了Swift 2.0-我沒有任何編譯錯誤ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks'除外ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks'但根據我的搜索,這並不是我遇到的最大問題。 我不知道該怎么辦了。

如果您需要我的代碼的一部分或任何其他內容,請告訴我,我將其發布:)

謝謝!

編輯 :將情節提要更改為從常規ViewController和標簽開始,並且運行良好。 似乎它與我使用UISplitViewController 這是來自AppDelegate.swift的一些代碼:

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

    //get split VC
    let splitViewController = self.window!.rootViewController as! UISplitViewController
    splitViewController.delegate = self

    //Configure the master part
    let masterNavigationController = splitViewController.viewControllers[0] as! UINavigationController
    masterNavigationController.navigationBar.tintColor = UIColor(red: 236/255, green: 240/255, blue: 241/255, alpha: 1)
    masterNavigationController.navigationBar.barTintColor = UIColor(red: 40/255, green: 162/255, blue: 47/255, alpha: 1)
    let controller = masterNavigationController.topViewController as! NoteListViewController
    controller.context = self.managedObjectContext!


    //configure the detail
    let detailNavController = splitViewController.viewControllers.last as! UINavigationController
    let detailViewController = detailNavController.topViewController as! NoteDetailViewController
    detailViewController.navigationItem.leftItemsSupplementBackButton = true
    detailViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem()
    detailNavController.navigationBar.barTintColor = UIColor(red: 40/255, green: 162/255, blue: 47/255, alpha: 1)



    //configure the data for detail
    controller.delegate = detailViewController
    let firstNote = fetchFirstResult(inContext: controller.context)
    if firstNote != nil{
        detailViewController.note = firstNote
        detailViewController.context = self.managedObjectContext!
        controller.tableIsEmpty = false
        controller.appHasLoadedOnce = false
    }




    return true
}

檢查您的情節提要。 似乎您的屏幕上包含帶有默認文本的TextField。 只需清除此TextField中的文本,然后重試。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM