我创建了一个没有 ARC 的新项目,但没有 dealloc 方法

发布于 2024-12-26 01:02:05 字数 201 浏览 5 评论 0原文

自从我在 Xcode 中创建新项目以来已经有一段时间了。

今天我创建了一个新的“选项卡式应用程序”,我注意到 Xcode 创建的 firstViewControllersecondViewController 没有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

魂归处 2025-01-02 01:02:05

是的,-dealloc 始终需要由您实现。无论模板类型如何,它默认都不存在。

Yes, the -dealloc always needs to be implemented by you. It doesn't exist by default regardless of template type.

分分钟 2025-01-02 01:02:05

自己写几次后,你就会记住它......

在 Xcode 4 中,control option command 2 调出一个代码片段库。您可以找到 dealloc 和其他您过去可能已经习惯的生成代码

- (void)dealloc {
    //deallocations
    [super 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

- (void)dealloc {
    //deallocations
    [super dealloc];
}
孤独陪着我 2025-01-02 01:02:05

是的,你必须自己写下来

 - (void)dealloc {
  //deallocations
  [super dealloc];
   }

yes you have to write it down by yourself

 - (void)dealloc {
  //deallocations
  [super dealloc];
   }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文