จะอ่านบันทึกข้อขัดข้องที่เป็นสัญลักษณ์ iOS นี้ได้อย่างไร

Apple ปฏิเสธเวอร์ชันใหม่ของ APP และส่งบันทึกข้อขัดข้องกลับมาให้ฉัน มันยากสำหรับฉันที่จะพบปัญหา แม้ว่าบันทึกข้อขัดข้องนั้นจะเป็นสัญลักษณ์ใน Xcode จากข้อความต่อไปนี้ ฉันเดาว่ามีบางอย่างผิดปกติใน func getGameCenterScore ที่บรรทัด 246 หรือไม่ มันบอกปัญหาเพิ่มเติมหรือไม่?

BTW ก่อนที่จะเรียกใช้ func GameCenterScore(), GKLocalPlayer.localPlayer().authenticated จะถูกตรวจสอบ แต่ไม่ได้ตรวจสอบเครือข่าย ฉันต้องคิดว่ามันเป็นปัญหาที่นี่ ข้อเสนอแนะใด ๆ ?

ขอบคุณ.

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
                }
            }

        }
    }
}

person jdleung    schedule 05.05.2015    source แหล่งที่มา
comment
กรุณาโพสต์รหัสสำหรับฟังก์ชั่นนี้: getGameCenterScore   -  person pteofil    schedule 05.05.2015
comment
@pteofil func โพสต์และทำเครื่องหมายบรรทัด 246 ขอบคุณ.   -  person jdleung    schedule 05.05.2015


คำตอบ (1)


เพิ่งผ่านเรื่องเดียวกันมา การปฏิเสธแบบไบนารีสำหรับแอปที่ฉันอัปโหลด ในที่สุดก็ได้รับการยอมรับแล้ว ฉันพบหมายเลขบรรทัดเหมือนกับที่คุณพบ (ฉันใช้ textWrangler และเปรียบเทียบข้อความสัญลักษณ์กับข้อขัดข้องดั้งเดิม และมีเพียงบรรทัดเดียวที่เป็นไปได้ เช่นเดียวกับ 216 ของคุณ) บรรทัดที่แสดงเป็น Swift:0 อยู่หลังบรรทัดที่ทำให้เกิดข้อขัดข้อง

วิธีแก้ไขหรือขจัดปัญหา: 1) ฉันพบว่าผีสามารถอยู่ในโค้ดที่รวดเร็วของฉันได้ ทำความสะอาดและสร้างใหม่ ลองย้ายโค้ดไปมา 2) โปรดทราบว่าบรรทัดที่แสดงข้อขัดข้องอาจหายไปสองสามบรรทัด บรรทัดที่แสดงสำหรับแอปของฉันคือความคิดเห็น ข้อผิดพลาดคือโค้ดด้านบนและโค้ดนั้นดูโอเค ฉันแก้ไขมันด้วยการเขียนใหม่ด้วยวิธีอื่น 3) ดูรหัสของคุณอย่างระมัดระวัง

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

สิ่งนี้จะล้มเหลวหรือไม่หาก gameCenterScore ของคุณ == topScore

person Mountain Man    schedule 10.06.2016