Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我有一组在高级应用程序“重新启动”例程中发布的自定义 UIViewController,那么发布他们的视图的好方法是设置
self.view = nil;
在dealloc方法中?
我不确定您的视图在哪里,但您通常希望将它们从超级视图中删除(如果有的话)
[someView removeFromSuperview];
如果它被其他东西而不是它的超级视图保留,你会想要释放它
[someView release];
假设您的 retainCount 为 0,将调用 dealloc(在 99% 的情况下,您永远不应该自己调用 dealloc)
那么是的,你会想要零它。
someView = nil;
然后你可以重新创建你的视图或任何你想做的事情。