In my iphone app while sending some packets app is crashing when there are more number of packets and its throwing an alert on xcode saying terminating app due to memory pressure. In my code in few places I have allocating some objects in a for loop and adding those allocated objects to a queue so just after adding that i want to release those objects inside the for loop , since its ARC enabled project i cant release it , my question is will nil Help in this case? instead of release it, if we set those objects to nil,,will it release the memory (i know nil will not decrease the retain count) is setting nil will help to reduce the memory usage?
say my code is some what like the following example
NSMutableArray* arrObj = [[NSMutableArray alloc]init];
for(i=0; i<=count;i++)
{
ClassA * Obja = [[classA alloc]initwithdata:xx];
ClassB * Objb = [[classB alloc]initwithdata:xx];
ClassC * Objc = [[classC alloc]initwithdata:xx];
[arrObj addObject:obja]; // Since its ARC we cant release obja will obja=nil this help?
[arrObj addObject:objb]; // Since its ARC we cant release objb will objb=nil this help?
[arrObj addObject:objc]; // Since its ARC we cant release objc will objc=nil this help?
}