Note that there are some explanatory texts on larger screens.

plurals
  1. POTabbar items are empty
    primarykey
    data
    text
    <p>I've been online for about an hour now trying to find different ways to set custom images i have onto my tab bar. I am using a resizing class. it's <code>UIImage+ProportionalFill</code> if anyone is familiar with it. I am a bit new to Objective-C and I have little knowledge on using <code>AppDelegate.h</code> here is my code. feel free to rip me a new one because I'm sure its probably going to be a rookie mistake.</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions { // [UIApplication sharedApplication].idleTimerDisabled = YES; [application setStatusBarStyle:UIStatusBarStyleBlackOpaque]; [[UITabBar appearance] setBackgroundColor:[UIColor colorWithRed:0/255.0 green:255/255.0 blue:255/255.0 alpha:1.0]]; UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; UITabBar *tabBar = tabBarController.tabBar; UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0]; UITabBarItem *tabBarItem2 = [tabBar.items objectAtIndex:1]; UITabBarItem *tabBarItem3 = [tabBar.items objectAtIndex:2]; UITabBarItem *tabBarItem4 = [tabBar.items objectAtIndex:3]; UITabBarItem *tabBarItem5 = [tabBar.items objectAtIndex:4]; UIImage *oldProfile= [UIImage imageNamed:@"profile.png"]; UIImage *oldFeed = [UIImage imageNamed:@"feed.png"]; UIImage *oldSearch = [UIImage imageNamed:@"search.png"]; UIImage *oldNotifications = [UIImage imageNamed:@"notification.png"]; UIImage *oldMap = [UIImage imageNamed:@"compass.png"]; UIImage *newProfile; UIImage *newFeed; UIImage *newSearch; UIImage *newNotifications; UIImage *newMap; CGSize newSize = CGSizeMake(30, 30); newProfile = [oldProfile imageScaledToFitSize:newSize]; newFeed = [oldFeed imageScaledToFitSize:newSize]; newSearch = [oldSearch imageScaledToFitSize:newSize]; newNotifications = [oldNotifications imageScaledToFitSize:newSize]; newMap = [oldMap imageScaledToFitSize:newSize]; [tabBarItem1 setFinishedSelectedImage:newFeed withFinishedUnselectedImage:newFeed]; [tabBarItem2 setFinishedSelectedImage:newMap withFinishedUnselectedImage:newMap]; [tabBarItem3 setFinishedSelectedImage:newSearch withFinishedUnselectedImage:newSearch]; [tabBarItem4 setFinishedSelectedImage:newNotifications withFinishedUnselectedImage:newNotifications]; [tabBarItem5 setFinishedSelectedImage:newProfile withFinishedUnselectedImage:newProfile]; // Override point for customization after application launch. UIApplication* app = [UIApplication sharedApplication]; app.networkActivityIndicatorVisible = YES; return YES; } </code></pre> <p><em>EDIT</em> the error I receive is: </p> <pre><code> -[UINavigationController tabBar]: unrecognized selector sent to instance *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '- [UINavigationController tabBar]: unrecognized selector sent to instance ` </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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