title: pass data from mainView to a subview
body: <p>I am building a utility-based application, the data is stored in the <code>MainViewController</code>, and  now I know how to pass data to the <code>FlipsideViewController</code> (many regards to this thread BTW, <a href="https://stackoverflow.com/questions/5293957/sending-data-from-mainview-to-flipside">Sending data from Mainview to Flipside?</a>). But I am getting the data onto an subview (subclass of <code>UIView</code>) that I have added to the flipside view. How can I pass data to this subview? I saw there is already a delegate and protocol set up in the <code>FlipsideViewController.h</code>, I am really new to the delegate sort of things. Any help would be greatly appreciated!</p>
  
  <hr>
  
  <p>Updates:</p>
  
  <p>On the main view, I have a couple of text fields for users to input to create an object. All the objects are stored in an array. Namely, my data is created and stored in the <code>MainViewController</code>. Now on the flip side, I have a custom UIView subclass which allows me to do my own drawing based on the data in that array. What I need to do here is pass the data that stored in <code>MainViewController</code> to this subview. Here is my relevant code:</p>
  
  <p>In the <code>MainViewController.m</code></p>
  
  <pre><code>- (IBAction)showInfo:(id)sender {    
  
      FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"FlipsideView" bundle:nil];
      controller.delegate = self;
  
      controller.receiver = data;//this is what I've done.
  
      controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
      [self presentModalViewController:controller animated:YES];
  
      [controller release];
  }
  </code></pre>
  
  <p>In the <code>FlipsideViewController.h</code></p>
  
  <pre><code>@protocol FlipsideViewControllerDelegate;
  
  @interface FlipsideViewController : UIViewController {
      id &lt;FlipsideViewControllerDelegate&gt; delegate;
      DataModel *receiver; //create a property to receive the data transferred from main view
  }
  
  @property (nonatomic, assign) id &lt;FlipsideViewControllerDelegate&gt; delegate;
  @property (nonatomic, retain) DataModel *receiver;
  - (IBAction)done:(id)sender;
  @end
  
  
  @protocol FlipsideViewControllerDelegate
  - (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller;
  @end
  </code></pre>
  
  <p>In the above code, "data" is an DataModel object declared in the <code>MainViewController.h</code> file.</p>
  
  <p>And I want to do my custom drawing in <code>drawing</code> class (subclass of UIView), how can I pass data from the <code>FlipsideViewController</code>to this subview? Do I need to make use of delegate declared in the <code>FlipsideViewController.h</code> file? Thanks in advance!</p>