NSManagedObject - NSSet gets removed ??

Posted by aryaxt on Stack Overflow See other posts from Stack Overflow or by aryaxt
Published on 2011-02-23T23:22:23Z Indexed on 2011/02/23 23:25 UTC
Read the original article Hit count: 342

I have an nsmanagedObject this NSManagedObject contains an NSSet.

the data for NSSet get's lost when i call release on an NSManagedObject with retain count of 2.

Wouldn't retaining an NSManagedObject also retain all it's properties??

- (id)initViewWithManagedObject :(NSManagedObject)obj
{
     if (self = [super init])
     {
          self.managedObject = obj;
     }
}

- (void)dealloc
{
     [self.managedObject release];
     //Here is when the nsset data gets removed

     [super dealloc];
}

Below describes how the property was created

@interface MyManagedObject :NSManagedObject
@property (nonatomic, retain) NSSet *mySet;
@end

@implementation MyManagedObject
@dynamic mySet;
@end

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c