Setting UISearchBar Appearance in AppDelegate Not Working

Discussion in 'iOS Programming' started by nashyo, Apr 16, 2012.

  1. nashyo macrumors 6502

    nashyo

    Joined:
    Oct 1, 2010
    Location:
    Bristol
    #1
    Code:
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        // Override point for customization after application launch.
        self.viewController = [[SearchViewController alloc] initWithNibName:@"SearchViewController" bundle:nil];
        self.window.rootViewController = self.viewController;
        [self.window makeKeyAndVisible];
        return YES;
        
        UIImage *barImage = [UIImage imageNamed:@"BarTexture"];
        [[UISearchBar appearance] setBackgroundImage:barImage];
    }
    My rootviewcontroller has a UISearchBar object. Why doesn't my UISearchBar object load the 'BarTexture' image?
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    What is your understanding of how return works in terms of execution flow?
     
  3. nashyo thread starter macrumors 6502

    nashyo

    Joined:
    Oct 1, 2010
    Location:
    Bristol
    #3
    ha.

    my advice here would be; avoid coding on a hangover.
     

Share This Page