UIBarButtonItem problemas de apariencia en iOS 7, ¿podría ser esto un error de Apple?

Hace un tiempo vi un artículo, que está aquí:

Personalización de la interfaz de usuario en iOS 6

Muestra la personalización para iOS 6. Desde el artículo que escribí Aplicaciones que usan la técnica, es bastante sencillo, no hay magia allí.

Sin embargo, necesito actualizar una de mis aplicaciones y en iOS 7 no funciona correctamente. Parece que la personalización de UIBarButtonItems no funciona la primera vez que se presenta la vista. Si descarto la vista y luego la presento de nuevo, todo funciona bien. Lo que se ve se muestra aquí:

Se presenta la primera vista de tiempo:

Segunda vez:

He visto este problema en su ejemplo, mi código y una aplicación de prueba que escribí. El código es el siguiente:

// Customizing the Back Bar Buttons
UIImage * btBack_30 = [[UIImage imageNamed:@"btBack_30"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 5)];
UIImage * btBack_24 = [[UIImage imageNamed:@"btBack_24"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 12, 0, 5)];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:btBack_30 forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:btBack_24 forState:UIControlStateNormal barMetrics:UIBarMetricsLandscapePhone];

Como puede ver, no hay magia real, bastante estándar, pero no puedo encontrar ninguna razón o explicación por la que esto no funcione en iOS 7. El código se ejecuta en- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions.

Espero que alguien haya visto esto y pueda ofrecer una solución. ¡Gracias por cualquier ayuda!

** Nota: se propuso que esto no es un error de Apple, sino por diseño. No estoy diciendo que sea un problema de Apple, es más probable que sea mío, pero si ejecuta cualquiera de las muestras o copia y pega el código a continuación, es evidente que la primera vez no funciona correctamente y las veces posteriores lo hacen. Eso me llevaría a creer que las llamadas a api son válidas, pero o tienen un error, o me falta algo que deba hacerse.

**** ACTUALIZACIÓN 4: **

Cambié el código en el método de inicio de MyAppDelegate en mi muestra al siguiente basado en la sugerencia de FruityGeek, pero aún no hay suerte:

- (instancetype)init
{
    self = [super init];
    if (self)
    {
        //Other UIAppearance proxy calls go here

        [[UIBarButtonItem appearance] setTitleTextAttributes:
         [NSDictionary dictionaryWithObjectsAndKeys:
          //[UIColor colorWithRed:220.0/255.0 green:104.0/255.0 blue:1.0/255.0 alpha:1.0],
          [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
          UITextAttributeTextColor,
          //[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0],
          [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
          UITextAttributeTextShadowColor,
          [NSValue valueWithUIOffset:UIOffsetMake(0.5, 0.5)],
          UITextAttributeTextShadowOffset,
          [UIFont systemFontOfSize:12.0],
          UITextAttributeFont,
          nil]
                                                    forState:UIControlStateNormal];

        // Customizing the Back Bar Buttons
        //ios6 uses whole button background image
        UIImage * btBack_30 = [[UIImage imageNamed:@"btBack_30"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 5)];
        UIImage * btBack_24 = [[UIImage imageNamed:@"btBack_24"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 12, 0, 5)];
        [[UIBarButtonItem appearance] setBackButtonBackgroundImage:btBack_30 forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
        [[UIBarButtonItem appearance] setBackButtonBackgroundImage:btBack_24 forState:UIControlStateNormal barMetrics:UIBarMetricsLandscapePhone];

        if ([[UIDevice currentDevice].systemVersion integerValue] >= 7)
        {
            //ios7 needs additional chevron replacement image
            UIImage * chevronReplacement = chevronReplacement = [btBack_30 imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
            UIImage * chevronTransitionMaskReplacement = chevronTransitionMaskReplacement = [btBack_30 imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
            [[UINavigationBar appearance] setBackIndicatorImage:chevronReplacement];
            [[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:chevronTransitionMaskReplacement];
        }
    }
    return self;
}

**** ACTUALIZACIÓN 3: **

He añadido un enlace de Dropbox a un proyecto de muestra. Esto es además del enlace publicado anteriormente, que es una aplicación simple que también muestra el problema. Ambos se pueden construir y ejecutar en el simulador con iOS 6 y iOS 7. En el caso de iOS 6, todo funciona como se espera. En iOS 7, si hace clic en la celda de la tabla y presenta la siguiente vista, no se muestra el botón Atrás personalizado. Si regresa y lo presenta nuevamente, el botón está allí.

He estado engañando con esto durante días, así que espero que alguien más lo vea y pueda decirme lo que me estoy perdiendo.

https://www.dropbox.com/s/oi1bh3emvtbmms0/NavigationBarDemo.zip

Esto puede ser tonto, pero ¿podría tener que ver con mis imágenes? Voy a probar la muestra con diferentes imágenes y publicar una actualización.

Probé con diferentes imágenes y eso no hace ninguna diferencia, también usé imágenes de la muestra publicada anteriormente. Era una posibilidad remota, pero como nadie parece tener una mejor idea, vale la pena intentarlo.

**** ACTUALIZACIÓN 2: **

He intentado esto en otra aplicación de prueba y moví el código a la inicialización del delegado de la aplicación y aún no funciona. He publicado esto aquí, así como el sitio original de autores del enlace en la parte superior. Además de otro foro, pero nadie parece tener una solución.

Me pregunto si esto podría ser un error de Apple?

**** ACTUALIZACIÓN 1: **

Código movido dedidFinishLaunchingWithOptions awillFinishLaunchingWithOptions yinit y todavía no parece funcionar.

***** INIT METHOD FROM AppDelegate.m

- (id)init
{
    // Create resizable images
    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 *all* UINavigationBars
    [[UINavigationBar appearance] setBackgroundImage:gradientImage44 forBarMetrics:UIBarMetricsDefault];
    [[UINavigationBar appearance] setBackgroundImage:gradientImage32 forBarMetrics:UIBarMetricsLandscapePhone];

    // Customize the title text for *all* UINavigationBars
    [[UINavigationBar appearance] setTitleTextAttributes:
     [NSDictionary dictionaryWithObjectsAndKeys:
      [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
      UITextAttributeTextColor,
      [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
      UITextAttributeTextShadowColor,
      [NSValue valueWithUIOffset:UIOffsetMake(1, 1)],
      UITextAttributeTextShadowOffset,
      [UIFont boldSystemFontOfSize:18.0],
      UITextAttributeFont,
      nil]];

    // Customizing the NavBar Buttons
    UIImage * button30 = [[UIImage imageNamed:@"btButton_30"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 5, 0, 5)];
    UIImage * button24 = [[UIImage imageNamed:@"btButton_24"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 5, 0, 5)];
    [[UIBarButtonItem appearance] setBackgroundImage:button30 forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    [[UIBarButtonItem appearance] setBackgroundImage:button24 forState:UIControlStateNormal barMetrics:UIBarMetricsLandscapePhone];

    [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]];

    [[UIBarButtonItem appearance] setTitleTextAttributes:
     [NSDictionary dictionaryWithObjectsAndKeys:
      //[UIColor colorWithRed:220.0/255.0 green:104.0/255.0 blue:1.0/255.0 alpha:1.0],
      [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
      UITextAttributeTextColor,
      //[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0],
      [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
      UITextAttributeTextShadowColor,
      [NSValue valueWithUIOffset:UIOffsetMake(0.5, 0.5)],
      UITextAttributeTextShadowOffset,
      [UIFont systemFontOfSize:12.0],
      UITextAttributeFont,
      nil]
                                                forState:UIControlStateNormal];

    // Customizing the Back Bar Buttons
    UIImage * btBack_30 = [[UIImage imageNamed:@"btBack_30"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 5)];
    UIImage * btBack_24 = [[UIImage imageNamed:@"btBack_24"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 12, 0, 5)];
    [[UIBarButtonItem appearance] setBackButtonBackgroundImage:btBack_30 forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    [[UIBarButtonItem appearance] setBackButtonBackgroundImage:btBack_24 forState:UIControlStateNormal barMetrics:UIBarMetricsLandscapePhone];

    return [super init];
}

Respuestas a la pregunta(5)

Su respuesta a la pregunta