Reputation: 1
I am trying to save UISwitch results and using them to populate the "channels" for Parse.com push notifications. I followed the Parse Guide but I am getting a SIGABRT everytime I try and click the save button which saves the values of the switch. Any help is much appreciated
@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()
}
}
Upvotes: 0
Views: 55
Reputation: 733
The problem is not with your code, it's with your main.storyboard. The SIGABRT error shows when a storyboard element is connected to some other element or outlet which does not exist anymore.
To fix this error:
Upvotes: 1