0
我試圖保存UISwitch結果並使用它們爲Parse.com推送通知填充「頻道」。我遵循了「分析指南」,但每次嘗試時我都會收到一個SIGABRT,然後單擊保存按鈕以保存交換機的值。任何幫助,非常感謝SIGABRT - 定位解析推送通知
@IBAction func Save(sender: AnyObject) {
if Athletics.on{
let currentInstallation = PFInstallation.currentInstallation()
currentInstallation.addUniqueObject("Athletics", forKey: "channels")
currentInstallation.saveInBackground()
}else{let currentInstallation = PFInstallation.currentInstallation()
currentInstallation.removeObject("Athletics", forKey: "channels")
currentInstallation.saveInBackground()
}
if Academics.on{
let currentInstallation = PFInstallation.currentInstallation()
currentInstallation.addUniqueObject("Academics", forKey: "channels")
currentInstallation.saveInBackground()
}else{let currentInstallation = PFInstallation.currentInstallation()
currentInstallation.removeObject("Academics", forKey: "channels")
currentInstallation.saveInBackground()
}
if LinkCrew.on{
let currentInstallation = PFInstallation.currentInstallation()
currentInstallation.addUniqueObject("LinkCrew", forKey: "channels")
currentInstallation.saveInBackground()
}else{let currentInstallation = PFInstallation.currentInstallation()
currentInstallation.removeObject("LinkCrew", forKey: "channels")
currentInstallation.saveInBackground()
}
if Events.on{
let currentInstallation = PFInstallation.currentInstallation()
currentInstallation.addUniqueObject("Events", forKey: "channels")
currentInstallation.saveInBackground()
}else{let currentInstallation = PFInstallation.currentInstallation()
currentInstallation.removeObject("Events", forKey: "channels")
currentInstallation.saveInBackground()
}
if Parents.on{
let currentInstallation = PFInstallation.currentInstallation()
currentInstallation.addUniqueObject("Parents", forKey: "channels")
currentInstallation.saveInBackground()
}else{let currentInstallation = PFInstallation.currentInstallation()
currentInstallation.removeObject("Parents", forKey: "channels")
currentInstallation.saveInBackground()
}
if Day1Day2.on{
let currentInstallation = PFInstallation.currentInstallation()
currentInstallation.addUniqueObject("Day1Day2", forKey: "channels")
currentInstallation.saveInBackground()
}else{let currentInstallation = PFInstallation.currentInstallation()
currentInstallation.removeObject("Day1Day2", forKey: "channels")
currentInstallation.saveInBackground()
}
}
要確定哪些語句創建錯誤,設置異常斷點:在Xcode中的斷點導航器,單擊加號下降然後選擇「添加異常斷點...」,然後點擊返回。運行你的應用程序,它會停止在有問題的指令。 –
爲什麼不更新所有頻道,然後在最後保存一次... – Wain