2011-02-06 64 views
0

请参考下面最好的办法

- (void) viewDidLoad() 
{ 
    NSMutableArray *tempArray = [[NSMutableArray alloc]init]; 
    [self setImagesArray:tempArray]; 
    [tempArray release]; 

    [self Display]; 
} 

-(void) display 
{ 
    //here I just add objects to imagesArray like 
    [self.imagesArray addObject:temp]; //temp is some image 
} 

现在我想知道我的代码,如果我释放imagesArray中的dealloc()将它导致内存泄漏,是对上述办法初始化声明为属性的数组。

Thanx提前。

+0

不要多次发表相同的问题。 – NSResponder 2011-02-06 13:04:57

+0

@NSResponder:我的网站很慢地正常运行。它发生了。我没有故意这样做。 – Aisha 2011-02-06 13:09:04

回答

0

正如我所理解的那样,您只需通过dealloc中的图像数组来进行正确的操作即可。