inheritance in a UIView file
<p>Simple question about inheritance</p>

<p>I have a standard program with a master view:</p>

<p><strong>MasterViewController.h</strong></p>

<p><code>enter code here</code>@interface MasterViewController : UIViewController</p>

<p>using a subview for drawing:</p>

<p><strong>MasterViewController.m</strong></p>

<pre><code>frame = CGRectMake(xo, yo,  side*width, side*height);   // maxSide
backView = [[BackView alloc] initWithFrame:frame];
[backView setBackgroundColor:[UIColor whiteColor]];
[self infoToBackView];
[self.view addSubview:backView];
</code></pre>

<p><strong>BackView.h</strong></p>

<pre><code>@interface BackView : UIView
</code></pre>

<p>and <strong>BackView.m</strong> has its drawRect:</p>

<pre><code>- (void)drawRect {
    :
    :
}
</code></pre>

<p>The problem I have is that I want BackView to inherit from MasterViewController, i.e. I want
Backview.h to be</p>

<pre><code>@interface BackView : MasterViewController
</code></pre>

<p>which allows it to inherit the variables it needs from MasterViewController.</p>

<p>The problem is that this does not work; BackView must inherit from UIView to be able to draw with DrawRect. Therefore, before calling the UIView BackView, I must send it the variables it needs for drawing:</p>

<pre><code>[self infoToBackView];
[backView setNeedsDisplay];
</code></pre>

<p>where infoToBackView is a method sending the needed variables to BackView.</p>

<p>The $64,000 question: How can I have a BackView that inherits from MasterViewController AND has drawRect?</p>