私の古いUIWebViewは、ARCを使用しているときに残っているようです.何らかの理由で、UIViewControllerから出た後でもOSX Safariの開発者ツールに表示されます.
次のように、UIWebView を含むビュー コントローラーへの遷移を割り当てています。
//Create settings view/tabbar
UITabBarController *tabController = [[NoRotateTabBarController alloc] init] ;
StyleViewController *styleTab = [[StyleViewController alloc] initWithNibName:@"StyleViewController" bundle:nil];
styleTab.tabBarItem.title = @"Style";
styleTab.tabBarItem.image = [UIImage imageNamed:@"EyeIcon.png"];
NSArray *tabsArray = @[styleTab];
tabController.viewControllers = tabsArray;
prevView = self.window.rootViewController;
[UIView
transitionWithView:self.window
duration:0.5
options:UIViewAnimationOptionTransitionFlipFromRight
animations:^(void) {
BOOL oldState = [UIView areAnimationsEnabled];
[UIView setAnimationsEnabled:NO];
self.window.rootViewController = tabController;
[UIView setAnimationsEnabled:oldState];
}
completion:nil];
私は次のようにそのビューから出てきます:
[UIView
transitionWithView:self.window
duration:0.5
options:UIViewAnimationOptionTransitionFlipFromLeft
animations:^(void) {
BOOL oldState = [UIView areAnimationsEnabled];
[UIView setAnimationsEnabled:NO];
self.window.rootViewController = prevView;
[UIView setAnimationsEnabled:oldState];
}
completion:nil];
UIWebView (int StyleViewController) は次のように作成されています。
@implementation StyleViewController
UIWebView *webView;
//viewDidLoad
webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 1)];
webView.scalesPageToFit = NO;
webView.scrollView.scrollEnabled = false;
webView.multipleTouchEnabled = false;
webView.alpha = 0;
webView.backgroundColor = [UIColor clearColor];
webView.opaque = false;
@end
ただし、Safari で調べると、古い UIWebView が積み重なっているように見え、古い UIWebView がまだメニューに表示されていることに気付きました。これは Safari の開発者ツールのバグですか? UIWebViews が確実にリリースされるようにする方法はありますか?