title: Does this code cause a retain cycle?
body: <p>I have a question, can this line cause any trouble?</p>
  
  <pre><code>self.window.rootViewController = self.viewController;
  </code></pre>
  
  <p>assuming both properties of <code>self</code> have a <code>retain</code> setter:</p>
  
  <pre><code>@property(nonatomic, retain) UIViewcontroller viewController;
  </code></pre>
  
  <p>my question is does this cause any weird object trees or retain cycles or memory problems? <code>viewController</code> has a retain count of <code>2</code> so if <code>self</code> wants to get rid of the memory, it can´t because the <code>self.window.rootViewController</code> still holds a reference to it? Or am I completely wrong? </p>
  
  <p><a href="https://i.stack.imgur.com/wQQ7M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wQQ7M.png" alt="enter image description here"></a></p>