运行应用程序时出现错误:
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
最佳答案
当头文件中存在未连接的链接时,通常会发生此类错误
即您将一个按钮添加到头文件中,然后按钮被删除,但头文件中的声明仍然存在。
检查您的 View Controller 和头文件以确保情况并非如此。
关于swift - 当我运行我的应用程序时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34962362/