title: iOS - Getting information from the View Controller to drawRect in the View
body: <p>My question relates to Assignment 3 in CS193p.</p>
  
  <p>Im having a terrible time getting <code>drawRect</code> in my View to receive information passed from my View Controller.  Basically, my goal is to pass view-specific information (like <code>self.view.size.width</code>) to the controller, have it make some modifications (like <code>result = self.view.size.width * 2</code>), and pass <code>result</code> back to <code>drawRect</code> so that it could take the new info and draw it.  Im pretty sure I have my delegation set up correctly, and really have tried a list of potential work-arounds:</p>
  
  <ul>
  <li><p>make a public View <code>@property</code>, which I access in my <code>controller.m</code> via</p>
  
  <p>View *newView
  someResult = newView.variable</p></li>
  </ul>
  
  <p>which I would then try to access from my <code>view.m</code> via</p>
  
  <pre><code>self.variable
  </code></pre>
  
  <ul>
  <li>use methods set in my View's <code>@protocal</code>, which I try to pass data via <code>myView.dataSource someMethod:someData</code></li>
  </ul>
  
  <p>But so far none of these are currently working (i.e. my <code>self.variable</code> would always come out to be 0, which shows that no data was passed to it).  Your help much appreciated!</p>
  
  <p>UPDATE:</p>
  
  <p>The culprit was that, in the storyboard, <strong>I didn't control-drag the View Controller to the View</strong>, and hence the Controller was never connected... but at least now it works. ^_^</p>