In have an NSManagedObject subclass:
@interface ManagedActivityAmount : NSManagedObject
@property (nonatomic, retain) NSNumber * distance;
@property (nonatomic, retain) NSNumber * duration;
@property (nonatomic, retain) NSSet *sets;
@end
@interface ManagedActivityAmount (CoreDataGeneratedAccessors)
- (void)addSetsObject:(ManagedPowerSet *)value;
- (void)removeSetsObject:(ManagedPowerSet *)value;
- (void)addSets:(NSSet *)values;
- (void)removeSets:(NSSet *)values;
@end
I encounter a problem in keeping a reference to an object that i added to the sets relationship using the:
- (void)addSetsObject:(ManagedPowerSet *)value;
the ManagedPowerSet object was successfully added to the ManagedActivityAmount sets property, and I'm assuming it's retain count is 1 due to this (the actual object was autoreleased before that so the retain count was 0 before adding it to the set). am I correct? am I missing something?
I'm assigning the ManagedPowerObject to another instance variable of the view controller (this is a private instance variable, not a retained property) but I can't seem to access it later. should I retain it? i'm just about to do so and check, but I really want to understand we it wasn't retained in the first place.
thanks :)