Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It does look like an Apple bug, and you should enter a bug on it with bug reporter. That said, I can give you a relatively painless workaround: add this code to your RecipetTableViewController:</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; self.title = @"Recipe Book"; UIBarButtonItem *it = [[UIBarButtonItem alloc] initWithTitle:self.title style:UIBarButtonItemStylePlain target:nil action:NULL]; UIImage * btBack_30 = [[UIImage imageNamed:@"btBack_30"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 5)]; [it setBackButtonBackgroundImage:btBack_30 forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; self.navigationItem.backBarButtonItem = it; } </code></pre> <p>EDIT: You can dup this bug if interested, the more bugs referencing it the more likely apple will fix it:</p> <blockquote> <p>BUG: 15506447 </p> <p>State:OpenProduct:iOS</p> <p>19-Nov-2013 03:53 PM</p> <p>Summary: Setting the UIBarButtonItem appearance proxy for the back bar button item does not have any affect until the second appearance of the button.</p> <p>Steps to Reproduce: In appDelegate, before anything has appeared, add these statements:</p> <p>UIImage * gradientImage44 = [[UIImage imageNamed:@"navBar_44"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; UIImage * gradientImage32 = [[UIImage imageNamed:@"navBar_32"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; // Set the background image for <em>all</em> UINavigationBars [[UINavigationBar appearance] setBackgroundImage:gradientImage44 forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setBackgroundImage:gradientImage32 forBarMetrics:UIBarMetricsLandscapePhone];</p> <p>Expected Results: When a viewController is first pushed, its back button has the image in it.</p> <p>Actual Results: First time it appears, there is no image. Push the view again and its there. Actually it does appear when you click on the button the very first time, but not when the button first appears.</p> <p>Version: Xcode 5.0.1, iOS 7.0.3</p> <p>Notes: Adding this in the root view controller of the navigation controller makes it work:</p> <ul> <li><p>(void)viewDidLoad { [super viewDidLoad];</p> <p>self.title = @"Recipe Book"; UIBarButtonItem *it = [[UIBarButtonItem alloc] initWithTitle:self.title style:UIBarButtonItemStylePlain target:nil action:NULL]; UIImage * btBack_30 = [[UIImage imageNamed:@"btBack_30"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 5)]; [it setBackButtonBackgroundImage:btBack_30 forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; self.navigationItem.backBarButtonItem = it; }</p></li> </ul> <p>Attached demo project shows the problem.</p> <p>Configuration:</p> <p>Attachments: 'DynamicsCatalog.zip' was successfully uploaded.</p> </blockquote> <p>EDIT: I'm happy to say that again, entering bugs in bug reporter, does sometimes work!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COYEAH!!! I am glad someone at least recognized they saw it!!! Awesome and thank you!! I will try your work around, but it needs to go into my app so I will see if it works. I actually did do this much earlier, but did not want to do it this sway because I have multiple TableViewControllers in my App. I thought the problem was with the way I was using the appearance call. Anyway, I will give this a try and thanks again!!!!
      singulars
    2. COI tried every trick in the book, and a few more, all to no avail. the root problem is that Apple dynamically creates that button when it sees a need for it, probably in a special place that they didn't think to apply the appearance stuff to. There is just no way I can think of to bottleneck the creation of the back bar button without swizzling methods. Also, if you have multiple tableviews and a tabbarController, you may be able to have to tabBarController do this when it first loads each of the tableViewControllers - or you could do a small UITableView subclass with this in it.
      singulars
    3. COOMG, I am soo glad to hear from you. I read and read and I thought i tried everything but was going crazy. I am glad you saw it. I opened a support ticket with Apple so I will see how it goes. For now, I used what you proposed and put that in each of my TableViewControllers. Hey, quick question, maybe I am having a brain freeze, but how com the title of the button shows up as Back and not the name of the presenting view. I set it as follows: TVCCMSTopLevelMenu * svc; svc.title = homeIconObj.sTitle;
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload