1

在 ios6 中,我应该在收到内存警告时设置 strongIBOutletnil?我声明为实例变量并通过代码添加到视图层次结构中的视图呢?

4

2 回答 2

4

从 iOS6 开始,Apple 建议不要发布视图,只发布可以轻松恢复的缓存数据,例如下载的图像。这就是他们弃用viewDidUnload.

于 2013-09-27T08:58:53.763 回答
0

On top of Leo Natan's answer, it also wouldn't do you any good to just set the outlet to nil, as you would also need to remove the outlet from its superview. Before that you would need to check that the view property isn't visible (has no window property) as well as clearing out the view. It's complicated and unnecessary.

于 2013-09-27T09:04:12.170 回答