Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3805892
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:44:59+00:00 2026-05-19T14:44:59+00:00

I have a Universal App in which I customize my UINavigationBar. In my iPhone

  • 0

I have a Universal App in which I customize my UINavigationBar.
In my iPhone AppDelegate I use this to achieve it:

@implementation UINavigationBar (CustomImage)


static NSMutableDictionary *navigationBarImages = NULL;

- (void)initImageDictionary
{
 if(navigationBarImages==NULL){
    navigationBarImages=[[NSMutableDictionary alloc] init];
 }   
}

- (void)drawRect:(CGRect)rect
{

NSLog(@"drawing navbar2");
UIImage *imageName=[navigationBarImages objectForKey:[NSValue valueWithNonretainedObject: self]];
if (imageName==nil) {
    imageName=[UIImage imageNamed:@"bg_titleBar.png"];

UIImage *image = imageName;
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
}



- (void)setMyImage:(UIImage*)image
{

[navigationBarImages setObject:image forKey:[NSValue valueWithNonretainedObject: self]];
    [self setNeedsDisplay];
}

@end

Now my questions: why does this code get called, although I start the iPad simulator?

And more important it seems to corrupt the UIPopoverController because it looks like this:

http://awesome-apps.com/pic/ok.png

While it should look somehow like this:

http://awesome-apps.com/pic/nok.png

Besides it corrupts more in my App, but this should be it for starters 🙂

Can anyone help me with this? Have you ever had a similar experience?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T14:44:59+00:00Added an answer on May 19, 2026 at 2:44 pm

    So ignore the fact that it gets called when you run in the iPad simulator, because as you’ll see in a minute even if you used two different categories (one for iPhone, one for iPad) you’d still have this problem.

    Here’s why:

    You are using a category to override the UINavigationBar behaviour. I assume you know what that means – crucially any and all navigation bars in your app will use your supplied methods in the category.

    This can cause problems if you’re using standard apple elements that use UINavigationBars – the exact thing you’re seeing in the popover controller. What’s happening is the UIPopoverController uses a UINavigationBar. But because you’ve defined a category, the app assumes you want the popover navbar to use that category as well.

    So that’s why you’re seeing your weird behaviour in your pop-over controller.

    As long as you use categories you’ll have this problem, because you can’t selectively tell the system which bars should use your category.

    I’d suggest you tell us exactly you’re trying to customise in the navbar, because there are other ways to achieve customisation outside of categories.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone app which requires to be a universal app. Common between
I have a Universal app which is targeting 10.5 and which uses garbage collection.
I have written a universal app that's working fine on both iPhone (iPod Touch)
Convert iPad application to iPhone- Universal app. I already have one iPad application, now
I have an opengl game for iPhone/iPad (universal). I added the ability to send
So I'm making a universal app (iphone3gs/iphone4/ipad/)... But I have a question about images.
I have built a universal app. I have assets that are for both but
I have an already running iphone app with target OS 3.1. I am trying
I have several uiPopoverControllers in my universal iPad app. I now have a requirement
I have a new project which is an iPhone application. for that I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.