为什么将 nil 分配给 nsmutabledictioanry 并分配会导致崩溃并在此时显示内存释放?
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];
执行 nsmutabledictionary 分配后,我收到以下消息
* -[MATERIAL_ITEM release]: message sent to deallocated instance 0x11e62810>我已经在 ARC 中实现了我的项目