我正在尝试保存 UISwitch 结果并使用它们来填充 Parse.com 推送通知的“通道”。我按照 Parse Guide 进行操作,但每次尝试单击保存开关值的保存按钮时都会收到 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()
}
}