2015-05-05 63 views
1

蘋果公司拒絕了APP的新版本,並且發回給我的是崩潰日誌,我很難找到問題,即使崩潰日誌已經在Xcode中被符號化了。從以下內容來看,我認爲246行的func getGameCenterScore有問題嗎?它是否會告訴更多問題?如何讀取這個IOS符號化的崩潰日誌?

順便說一句,在調用func GameCenterScore()之前,會檢查GKLocalPlayer.localPlayer()。authenticated是否被檢查,但是網絡沒有被檢查。我必須在這裏認爲它有問題。任何建議?

Thx。

Exception Type: EXC_BREAKPOINT (SIGTRAP) 
Exception Codes: 0x0000000000000001, 0x0000000100054ef4 
Triggered by Thread: 0 

Thread 0 name: Dispatch queue: com.apple.main-thread 
Thread 0 Crashed: 
0 xoxo        0x0000000100054ef4 xoxo.ViewController.(getGameCenterScore (xoxo.ViewController) ->() -> Swift.Int).(closure #1) (ViewController.swift:246) 
1 xoxo        0x00000001000546b0 partial apply forwarder for reabstraction thunk helper from @callee_owned (@in ([Swift.AnyObject]!, ObjectiveC.NSError!)) -> (@out()) to @callee_owned (@owned [Swift.AnyObject]!, @owned ObjectiveC.NSError!) -> (@unowned()) with unmangled suffix "315" (ViewController.swift:0) 
2 xoxo        0x0000000100055110 reabstraction thunk helper from @callee_owned (@owned [Swift.AnyObject]!, @owned ObjectiveC.NSError!) -> (@unowned()) to @callee_unowned @objc_block (@unowned ObjectiveC.NSArray!, @unowned ObjectiveC.NSError!) -> (@unowned()) (ViewController.swift:0) 
3 GameCenterFoundation    0x000000018e9de3a0 0x18e964000 + 500640 
4 libdispatch.dylib     0x0000000197841990 0x197840000 + 6544 
5 libdispatch.dylib     0x0000000197841950 0x197840000 + 6480 
6 libdispatch.dylib     0x0000000197846208 0x197840000 + 25096 
7 CoreFoundation     0x0000000185a877f4 0x1859a8000 + 915444 
8 CoreFoundation     0x0000000185a8589c 0x1859a8000 + 907420 
9 CoreFoundation     0x00000001859b12d0 0x1859a8000 + 37584 
10 GraphicsServices     0x000000018f09f6f8 0x18f094000 + 46840 
11 UIKit        0x000000018a576fa8 0x18a500000 + 487336 
12 xoxo        0x00000001000636c0 main (AppDelegate.swift:12) 
13 libdyld.dylib      0x000000019786ea04 0x19786c000 + 10756 

func getGameCenterScore(){ 
    var gameCenterScore = 0 
    let leaderBoardRequest = GKLeaderboard() 
    leaderBoardRequest.identifier = "XXXXXXXXXXXXX" 

    leaderBoardRequest.loadScoresWithCompletionHandler { (scores, error) -> Void in 
     if (error != nil) { 
      println("Error: \(error!.localizedDescription)") 
     } else if (scores != nil) { 
      let localPlayerScore = leaderBoardRequest.localPlayerScore 
      gameCenterScore = Int(localPlayerScore.value) 

      if self.saveData.stringForKey("topScore") == nil { 
       self.saveData.setValue(gameCenterScore, forKey: "topScore") 
       self.topScoreLabel.text = "\(gameCenterScore)" 
      }else{ 
       if gameCenterScore > self.saveData.integerForKey("topScore"){ 
        self.saveData.setValue(gameCenterScore, forKey: "topScore") 
        self.topScoreLabel.text = "\(gameCenterScore)" // line 246 
       } 
      } 

     } 
    } 
} 
+0

請發佈這個func的代碼:'getGameCenterScore'。 – pteofil

+0

@pteofil,發佈的func和標記的行246。謝謝。 – jdleung

回答

1

剛剛經歷過他同樣的事情。二進制拒絕我上傳的應用程序。最後,被接受了。我發現線號很像你。 (我使用了textWrangler,並將符號化的文本與原始崩潰進行了比較,並且只有一行可能與之相同。) 以swift:0列出的行在崩潰後導致行。

解決或消除問題: 1)我發現幽靈可以留在我的swift代碼。清潔和重建。嘗試移動代碼。 2)請注意,崩潰列出的行可能會被關閉幾行。他們爲我的應用程序列出的行是一個評論。錯誤是上面的代碼,代碼看起來沒問題。我用不同的方式重寫了它。 3)仔細查看你的代碼。

if gameCenterScore > self.saveData.integerForKey("topScore"){`enter code here` 

如果您的gameCenterScore == topScore會崩潰嗎?