objective c - best way to initialize an array in terms of memory management -


please see code below

- (void) viewdidload() {   nsmutablearray *temparray = [[nsmutablearray alloc]init];   [self setimagesarray:temparray];   [temparray release];    [self display]; }  -(void) display {   //here add objects imagesarray     [self.imagesarray addobject:temp]; //temp image } 

now wanna know if release imagesarray in dealloc() cause memory leak , above way right initialize array declared property.

thanx in advance.

as understand doing right, relasing image array in dealloc.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -