I'm trying to add / remove channels from PFInstallation but I keep getting the same error message:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Operation is invalid after previous operation.'
My code:
NSString * channel=[NSString stringWithFormat:@"%@%@%@", city, @"_", self.titleLabel.text];
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
if([sender isOn]){
[currentInstallation addUniqueObject:channel forKey:@"channels"];
} else{
[currentInstallation removeObject:channel forKey:@"channels"];
}
[currentInstallation saveInBackground];