我创建了一个没有 ARC 的新项目,但没有 dealloc 方法
自从我在 Xcode 中创建新项目以来已经有一段时间了。
今天我创建了一个新的“选项卡式应用程序”,我注意到 Xcode 创建的 firstViewController
和 secondViewController
没有 dealloc
方法。
这是为什么?我必须自己创建它吗?
It's been some time since I created a new project in Xcode.
Today I created a new "tabbed Application" and I noticed that the firstViewController
and secondViewController
created by Xcode don't have a dealloc
method.
Why is that? do I have to create it myself?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,
-dealloc
始终需要由您实现。无论模板类型如何,它默认都不存在。Yes, the
-dealloc
always needs to be implemented by you. It doesn't exist by default regardless of template type.自己写几次后,你就会记住它......
在 Xcode 4 中,control option command 2 调出一个代码片段库。您可以找到 dealloc 和其他您过去可能已经习惯的生成代码
After writing it yourself a few times, you will have it memorized...
In Xcode 4, control option command 2 brings up a code snippet library. You can find dealloc and other generated code you may have gotten used to in the past
是的,你必须自己写下来
yes you have to write it down by yourself