#import #import @interface EOEditingContext (HSEOUtilities) - (NSArray *)objectsMatchingAllValues: (NSArray *)values // match ALL of these values forKey: (NSString *)key // for this key entityNamed: (NSString *)entityName; // on this entity - (NSArray *)objectsMatchingValues: (NSArray *)values // match these values forKey: (NSString *)key // for this key entityNamed: (NSString *)entityName // on this entity requiredMatches: (int)minMatches; // must match at least # values - (void)invalidateObjectsOfClass:(Class)aClass; @end @interface EOQualifier (HSEOUtilities) + (EOQualifier *)andQualifierToMatchAllValues: (NSArray *)values forKey:(NSString *)key; @end @interface NSObject (HSMultipleObjects) // remove multiple objects from a relationship - (void)removeObjects: (NSArray *)objects fromBothSidesOfRelationshipWithKey: (NSString *)key; // add multiple objects to a relationship - (void)addObjects: (NSArray *)objects toBothSidesOfRelationshipWithKey: (NSString *)key; // invalidate this object - (void)invalidateObjectInEditingContext; @end @interface NSArray (HSMultipleObjects) // add object to all elements in the receiver. - (void)addObject: (id)object toBothSidesOfRelationshipWithKey:(NSString *)key; // add object to all elements in the receiver. uses -addObjects:toBothSidesOfRelationshipWithKey: // ( HSMultipleObjects category on NSObject ) - (void)addObjects: (NSArray *)objects toBothSidesOfRelationshipWithKey:(NSString *)key; // remove objects from all elements in the receiver. - (void)removeObjects: (NSArray *)objects fromBothSidesOfRelationshipWithKey: (NSString *)key; - (void)removeObject: (id)object fromBothSidesOfRelationshipWithKey: (NSString *)key; // invalidate all objects in the receiver. - (void)invalidateObjectsInEditingContext; @end @interface NSNumber (HSBoolExtension) // Y == (BOOL)YES, N == (BOOL)NO + (NSNumber *)numberWithYesNoValue: (NSString *)aValue; @end