I have a "to->many" relationship in Core Data with no inverse relationship and the delete rule set to both "Nullify" and "No action" (by that I mean I've tried both with no avail)
Basically I have a MergedStation whose property subStations points to many Station objects: MergedStation.subStation -->> Station
When I call [mergedStation addSubStationsObject:newStation];
(which is dynamically created) everything works great and a new station is added, everything is refreshed and saved correctly so that the next time I open the program, all is right.
However, when I call [mergedStation removeSubStationsObject:stationToRemove];
(also dynamically created), everything deletes correctly only for the current program session. If I close the program and open it again, it's like I didn't change anything. I have the exact same methods called after both the add and remove methods:
[self.managedObjectContext refreshObject:station mergeChanges:YES];
[self.managedObjectContext processPendingChanges];
[self.managedObjectContext saveAndPrintErrors];
I have also tried different combinations of that above code to get it to work. Any help is appreciated!
Joe