nsmutabledictionary is showing memory leak

Posted by Narasimhaiah Kolli on Stack Overflow See other posts from Stack Overflow or by Narasimhaiah Kolli
Published on 2013-11-05T09:50:27Z Indexed on 2013/11/05 9:53 UTC
Read the original article Hit count: 208

Filed under:
|

Why doing assigning nil to nsmutabledictioanry and allocating is crashing ans showing memory release at this point of place??

    self.delegate.replenishAddedmaterials = nil;
    self.delegate.replenishAddedmaterials = [[NSMutableDictionary alloc] init];
    MATERIAL_ITEM *materialItem = [[MATERIAL_ITEM alloc] init];
    VENDOR_HEADER *vendor = [[VENDOR_HEADER alloc] init];
    PURCHASING_ORG_HEADER *purOrg = [[PURCHASING_ORG_HEADER alloc] init];

    [self.delegate.replenishAddedmaterials setObject:[NSMutableArray arrayWithObject:materialItem] forKey:materialItem];
    [[self.delegate.replenishAddedmaterials objectForKey:materialItem] addObject:vendor];
    [[self.delegate.replenishAddedmaterials objectForKey:materialItem] addObject:purOrg];

After executing allocation of nsmutabledictionary i am getting following message

* -[MATERIAL_ITEM release]: message sent to deallocated instance 0x11e62810>I have implemented my project in ARC

© Stack Overflow or respective owner

Related posts about iphone

Related posts about memory-management