nsmutabledictionary is showing memory leak
- by Narasimhaiah Kolli
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 0x11e62810I have implemented my project in ARC