开发者

Why dealloc is not generated by default in UIViewController class?

开发者 https://www.devze.com 2023-04-11 01:41 出处:网络
This is something I have been curious about: If you create a new UIViewController subclass in Xcode, they stub in a few functions including ViewDidUnload. But there is no dealloc method.

This is something I have been curious about:

If you create a new UIViewController subclass in Xcode, they stub in a few functions including ViewDidUnload. But there is no dealloc method.

Why wouldn'开发者_JAVA技巧t they stub that method into the class?


You can create your own templates for Xcode. If you want to add a dealloc method to your template, go for it.

Look in ~/Library/Application Support/Apple/Developer Tools/Templates/.


I think that's a reasonable question - it would seem including it would make sense, given there's a high liklihood that it would be used. But I suppose the only answer which is possible here, is that they decided not to (for whatever reason). You can of course add it yourself - and in iOS5 it may be fairly redundant with ARC.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号