Switch what displays in a navigation bar
<p>I have a project using CoreData with three tableViews:  Top, Middle, Bottom.  </p>

<p>On the Top tableView, I made a Category to use an image in the navigation bar to be used on the first screen only.  I added the code to the AppDelegate like so:</p>

<pre><code>@implementation UINavigationBar (UINavigationBarCategory)
- (void)drawRect:(CGRect)rect 
{
    UIImage *img  = [UIImage imageNamed: @"WFAppBanner.png"];
    [img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
</code></pre>

<p>This works fine.  </p>

<p>On the Middle and Bottom navigation bars, I want a white background with black text without using an image.  I want to do a conditional statement as follows:</p>

<pre><code>@implementation UINavigationBar (UINavigationBarCategory)
- (void)drawRect:(CGRect)rect 
{   
    if (RootViewController.entityName = @"Category") {

    UIImage *img  = [UIImage imageNamed: @"WFAppBanner.png"];
    [img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    }
    else {
        UIColor *color = [UIColor whiteColor];
        CGContextRef = UIGraphicsGetCurrentContext();
        CGContextSetFillColor(context, CGColorGetComponents( [color CGColor]));
        CGContextFillRect(context, rect);
    }
}
</code></pre>

<p>I get the error on the <code>RootViewController.entityName</code>:</p>

<pre><code>- Property on entityName not found on object of type RootViewController.
</code></pre>

<p>I also get this error:</p>

<pre><code>- Use of undeclared identifier context.
</code></pre>

<p>Is what I want to do possible?  If so, how?</p>

<p>Thanks for your time.</p>
