When I generate my classes from CoreData entities I get generated methods
@interface Site (CoreDataGeneratedAccessors)
- (void)addSearchesObject:(Search *)value;
- (void)removeSearchesObject:(Search *)value;
- (void)addSearches:(NSSet *)value;
- (void)removeSearches:(NSSet *)value;
@end
So my question is pretty simple when I call removeSearchesObject:myObject do I have to delete it too ?
[site removeSearchesObject:[[fetchedResultsController fetchedObjects] objectAtIndex:indexPath.section]];
[context deleteObject:[[fetchedResultsController fetchedObjects] objectAtIndex:indexPath.section]];
Here is the generated code (from the doc)
- (void)removeEmployeesObject:(Employee *)value
{
NSSet *changedObjects = [[NSSet alloc] initWithObjects:&value count:1];
[self willChangeValueForKey:@"employees"
withSetMutation:NSKeyValueMinusSetMutation
usingObjects:changedObjects];
[[self primitiveEmployees] removeObject:value];
[self didChangeValueForKey:@"employees"
withSetMutation:NSKeyValueMinusSetMutation
usingObjects:changedObjects];
[changedObjects release];
}