ios6不允许viewDidUnload,所以如何兼容viewDidUnload和didReceiveMemoryWarning来调用。我需要
- (void)viewDidUnload{
self.listArr=nil;
[super viewDidUnload];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
float sysVer =[[[UIDevice currentDevice] systemVersion] floatValue];
if (sysVer>= 6.0f){
if([self isViewLoaded] && !self.view.window){
self.listArr=nil;
self.view = nil;
}
}
NSLog(@" BrowseComment didReceiveMemoryWarning");
}
或仅在 ios5 和 ios6 使用以下代码
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
if([self isViewLoaded] && !self.view.window){
self.listArr=nil;
self.view = nil;
}
NSLog(@" BrowseComment didReceiveMemoryWarning");
}