aryDesc = [[NSMutableArray alloc]init];
NSMutableArray *ary_Temp ;
ary_Temp = [[NSMutableArray alloc]init ];
[ary_Temp addObject:@"Collins Burns"];
[ary_Temp addObject:@"cburns"];
[ary_Temp addObject:@"Active"];
[aryDescListing addObject:ary_Temp];
[ary_Temp removeAllObjects];
[ary_Temp addObject:@"Collins Burns"];
[ary_Temp addObject:@"cburns"];
[ary_Temp addObject:@"Active"];
[aryDescListing addObject:ary_Temp];
[ary_Temp removeAllObjects];
NSLog(@"ary Description===== >>>%@",aryDescListing);
My code is as above i do get two objects in log but both are empty i dont know wheather to use remove all objects or to dealloc for ary_Temp .Should i use removeAllobjects or alloc it everytime after i add it to aryDescListing.
Thanks
Don’t use
dealloc, instead userelease.deallocwill deallocate the object without taking in count the retain count of it and it will break your app sooner or later.Perhaps you want this? :
BTW:
removeAllObjectwill remove the objects from the array (and will decrease theirretainCountby one) but not will release the array.