Does UIView's addSubview really retain the view?

后端 未结 3 1304
时光取名叫无心
时光取名叫无心 2020-12-08 09:09

I ran into a situation that seems to suggest otherwise. In the following code snippet, if I remove the line: self.navigationController = nav, the root controller\'s view wo

3条回答
  •  悲&欢浪女
    2020-12-08 09:46

    This doesn't look lika a retain/release question to me. You view won't show up if you comment out self.navigationController = nav; because then in the next line, [window addSubview:self.navigationController.view] your self.navigationController property won't be set. It's probably nil or it would crash but can't say for sure without more of the code.

提交回复
热议问题