2016-01-23 93 views
0

在運行應用程序,我得到錯誤:我有錯誤,當我跑我的應用程序

Thread:1 EXC_BAD_INSTRUCTION(code=EXC_1386_INVOP, subcode=0×0)

我的代碼:

NotificationManager.updateNotif(params){ 
      (result:Bool) in 
      if result { 
       cell.backgroundColor = UIColor.whiteColor() 
       // バッジを-1に 
       let val = NotificationManager.sharedInstance.notifTabbar.badgeValue 

       if Int(val!)!/*val?.toInt()*/ > 0 { 
        let badgStr = Int(val!)!/*val!.toInt()!*/ - 1 
        if badgStr == 0 { 
         NotificationManager.sharedInstance.notifTabbar.badgeValue = nil 
         UIApplication.sharedApplication().applicationIconBadgeNumber = 0 
        } 
        else{ 
         NotificationManager.sharedInstance.notifTabbar.badgeValue = String(stringInterpolationSegment: badgStr) 
         UIApplication.sharedApplication().applicationIconBadgeNumber = badgStr 
+0

是的,我們將需要更多的信息。你期待什麼結果?它在哪裏崩潰? –

+0

我正在做yik犛牛克隆,然後當我點擊「我」中的通知評論時,它發生了。 – stack0101

+0

「If Int(val!)!> 0」 – stack0101

回答

0

這些排序的錯誤通常,當你在你的頭文件未連接的鏈路出現問題

即你有一個按鈕,你添加到頭文件,按鈕然後刪除,但在頭文件中的聲明仍然存在。

檢查您的視圖控制器和頭文件,以確保不是這種情況。

相關問題