“dealloc” UIView 的未调用
我有简单的视图控制器
[.h]
@interface GLViewController : UIViewController <UISplitViewControllerDelegate>{
MGSplitViewController* splitController;
}
-(void)setSplitter: (MGSplitViewController*)splitter;
@end
[.mm]
- (void)loadView
{
GLView* glView = [[GLView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame] ];
glView.multipleTouchEnabled = YES;
self.view = glView;
[glView release];
}
- (void)setSplitter: (MGSplitViewController*)splitter
{
splitController = splitter;
}
首先,我初始化 GLViewController 并将其推送到 UINavigationController 中,它在 MGSplitController 中定义为详细视图控制器。但是当我弹出控制器时,不会调用 GLView 类的 dealloc 方法。 GLViewController 的 dealloc 方法中 self.view.retainCount 的值为 7,所以,看起来好像有什么东西将我的视图对象的引用计数器增加了 7,但它会是什么?
I have simple View controller
[.h]
@interface GLViewController : UIViewController <UISplitViewControllerDelegate>{
MGSplitViewController* splitController;
}
-(void)setSplitter: (MGSplitViewController*)splitter;
@end
[.mm]
- (void)loadView
{
GLView* glView = [[GLView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame] ];
glView.multipleTouchEnabled = YES;
self.view = glView;
[glView release];
}
- (void)setSplitter: (MGSplitViewController*)splitter
{
splitController = splitter;
}
First, I init and push GLViewController into UINavigationController, which is defined as detailed view controller in MGSplitController. But when I pop my controller back, dealloc method of GLView class isn't called. The value of self.view.retainCount in dealloc method of GLViewController is 7, so, it's looks like something increases the reference counter of my view object by 7, but what can it be?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论