memory leak with navBar
<p>Can you help me please to fix the memory leak ?</p>

<pre><code>#import &lt;Foundation/Foundation.h&gt;


@interface NavBar : NSObject 
{
    NSString* nav;
}

@property (nonatomic, retain) NSString* nav;

+ (NavBar *) sharedInstance;

@end


#import "NavBar.h"


@implementation NavBar

@synthesize nav;

-(void)dealloc
{
    [nav release];
}

+(NavBar *)sharedInstance 
{
    static NavBar *myInstance = nil;
    if (nil == myInstance) {
        myInstance  = [[[self class] alloc] init];
    }
    return myInstance;
}

@end
</code></pre>

<p>i have a leak here :</p>

<pre><code>- (void) viewWillAppear:(BOOL)animated 
{
    [NavBar sharedInstance].nav = @"navBar.png";
    self.navigationController.navigationBar.barStyle = UIBarStyleDefault;

    self.navigationController.navigationBar.tintColor = [UIColor clearColor];
    self.navigationController.navigationBar.barStyle = UIBarStyleDefault;
    self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:19/255.0 green:140/255.0 blue:130/255.0 alpha:1.0];

    [super viewWillAppear:animated];
}
</code></pre>

<p>in the delegate of my app:</p>

<pre><code>@interface UINavigationBar (CustomBackground)
- (void)drawRectCustomBackground:(CGRect)rect;
@end


@implementation UINavigationBar (CustomBackground)

- (void)drawRectCustomBackground:(CGRect)rect 
{

    if (self.barStyle == UIBarStyleDefault)
    {

            UIImage *image = [UIImage imageNamed:[NavBarStyles sharedInstance].navStyle];
            [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
            return;
    }

    [self drawRectCustomBackground:rect];
}
</code></pre>
