viewDidUnload在iOS6的不再是所謂的,所以作爲一個應用程序,並在viewDidUnload一些必要的事情解決方法我已經做到了這一點:將蘋果拒絕的應用程序進行手動調用viewDidUnload
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// only want to do this on iOS 6
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0) {
// Don't want to rehydrate the view if it's already unloaded
BOOL isLoaded = [self isViewLoaded];
// We check the window property to make sure that the view is not visible
if (isLoaded && self.view.window == nil) {
// Give a chance to implementors to get model data from their views
[self performSelectorOnMainThread:@selector(viewWillUnload)
withObject:nil
waitUntilDone:YES];
// Detach it from its parent (in cases of view controller containment)
[self.view removeFromSuperview];
self.view = nil; // Clear out the view. Goodbye!
// The view is now unloaded...now call viewDidUnload
[self performSelectorOnMainThread:@selector(viewDidUnload)
withObject:nil
waitUntilDone:YES];
}
}
}
是否有任何先例蘋果拒絕這樣的事情?由於時間限制,我不能冒險拒絕任何東西。