I am having errors trying to run this app with core data. Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unacceptable type of value for to-many relationship: property = "ingredient"; desired type = NSSet; given type = Ingredient;
I see that the core-generated accessors addIngredient: and removeIngredient: both take an NSSet as a parameter, so I tried changing that to Ingredient, but that didn't help. I suspect that although I change the parameter in the header, there is something going on in implementation that I can't see? Suggestions?
Recipe.h
@class IngredientList;
@interface Recipe : NSManagedObject
@property (nonatomic, retain) NSString * recipeName;
@property (nonatomic, retain) IngredientList *ingredientList;
@end
IngredientList.h
@class Ingredient, Recipe;
@interface IngredientList : NSManagedObject
@property (nonatomic, retain) Recipe *recipe;
@property (nonatomic, retain) NSSet *ingredient;
@end
@interface IngredientList (CoreDataGeneratedAccessors)
- (void)addIngredientObject:(Ingredient *)value;
- (void)removeIngredientObject:(Ingredient *)value;
- (void)addIngredient:(NSSet *)values;
- (void)removeIngredient:(NSSet *)values;
@end
Ingredient.h
@class IngredientList;
@interface Ingredient : NSManagedObject
@property (nonatomic, retain) NSString * ingredientName;
@property (nonatomic, retain) IngredientList *ingredientList;
@end