2013-02-19 26 views
0

我已經嘗試了很多,以阻止來自我的應用程序的所有泄漏。但是,當我從 服務器同步大量數據,然後我的ios應用程序泄漏內存。清理ios中的所有內存泄漏

現在我想要在間隔一段時間後清除所有泄漏的內存,或者您可以說每當我接到函數調用時。

-(void)didReceiveMemoryWarning 
{ 
    [super didReceiveMemoryWarning]; 

    UIAlertView* alertobj = [[UIAlertView alloc] initWithTitle:@"Info" message:@"This Application facing memory issue." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 
    [alertobj show]; 

    NSLog(@"memory issue occur"); 
    // Dispose of any resources that can be recreated. 
} 

有沒有什麼辦法?

回答

0

不,你不能那樣做。

我遇到類似的問題,在更小的塊同步數據和了解@autoreleasepool

我基本上同步在一個時間對象500〜1500〜這取決於有多少數據中的對象,在@autoreleasepool包裝他們一旦我完成了這些對象,就可以讓記憶保持低水平。