0

I have a category to display a custom image in an app's UINavigationBar. When the app comes back from the background the image sometimes disappears and all I am left with is a white navigation bar with buttons.

The category I'm using is below, can anyone advise please?

@implementation UINavigationBar (CustomImage)

-(void)drawRect:(CGRect)rect {

cardSmartAppDelegate *delegate = (cardSmartAppDelegate *)[[UIApplication sharedApplication] delegate];
    [delegate.navImage drawInRect:rect];
    }

    @end
bennythemink
  • 5,096
  • 4
  • 36
  • 54

1 Answers1

0

You shouldn't use a category to override a method. Sometimes it works, but often it doesn't. Rumor has it that it will quit working altogether soon.

See my code in this item for how to do what you want:

Custom UINavigationBar Background

Community
  • 1
  • 1
EricS
  • 9,650
  • 2
  • 38
  • 34