When I created a CoreData object with a one-to-many relationships, I get some methods (CoreDataGeneratedAccessors)
. Do we need to implement these methods?
The methods generated automatically are given below :
- (void)addCirqitsObject:(Cirqit *)value;
- (void)removeCirqitsObject:(Cirqit *)value;
- (void)addCirqits:(NSSet *)value;
- (void)removeCirqits:(NSSet *)value;
You do not have to implement those methods, but you can. In the case you don't, CoreData will generate them dynamically for you.
If you want overwrite the default implementation please read the Core Data Programming Guide (Custom To-Many Relationship Accessor Methods) to find a sample implementation.
A reason to overwrite might be to trigger additional calculations or updates before or after new Cirqit
objects being added or removed. But be aware of not to change the sample implementation code, just add your custom code - otherwise you might break your relationships handling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With