Showing posts with label UITabBarItem example. Show all posts
Showing posts with label UITabBarItem example. Show all posts

Monday, June 10, 2013

UITabBarItem UITabBarSystemItemMostViewed example in Objective C (iOS).

UITabBarItem UITabBarSystemItemMostViewed

UITabBarSystemItem
System items that can be used on a tab bar.

typedef enum {
UITabBarSystemItemMore,
UITabBarSystemItemFavorites,
UITabBarSystemItemFeatured,
UITabBarSystemItemTopRated,
UITabBarSystemItemRecents,
UITabBarSystemItemContacts,
UITabBarSystemItemHistory,
UITabBarSystemItemBookmarks,
UITabBarSystemItemSearch,
UITabBarSystemItemDownloads,
UITabBarSystemItemMostRecent,
UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

Constants
UITabBarSystemItemMore
The more system item.
UITabBarSystemItemFavorites
The favorites system item.
UITabBarSystemItemFeatured
The featured system item.
UITabBarSystemItemTopRated
The top rated system item.
UITabBarSystemItemRecents
The recents system item.
UITabBarSystemItemContacts
The contacts system item.
UITabBarSystemItemHistory
The history system item.
UITabBarSystemItemBookmarks
The bookmarks system item.
UITabBarSystemItemSearch
The search system item.
UITabBarSystemItemDownloads
The downloads system item.
UITabBarSystemItemMostRecent
The most recent system item.
UITabBarSystemItemMostViewed
The most viewed system item.

Discussion of [UITabBarItem UITabBarSystemItemMostViewed]
The title and image of system tab bar items cannot be changed.

UITabBarItem UITabBarSystemItemMostViewed example.
UITabBarItem *favorites = [[UITabBarItem alloc] initWithTitle:nil image:a1 tag:0];
UITabBarItem *bookmarks = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemBookmarks tag:1];
UITabBarItem *featured = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:2];
UITabBarItem *mostViewed = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemMostViewed tag:3];

Example of [UITabBarItem UITabBarSystemItemMostViewed].
//Create TabBar View here
-(void)createTabBarView
{
     NSMutableArray *tabItems = [NSMutableArray array];
     UIViewController *firstViewController = [[FirstViewController alloc] init];;
     firstViewController = @"First View";
     firstViewController = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemMostViewed tag:0];
      [tabItems addObject:firstViewController];
      UIViewController *secondViewController = [[SecondViewController alloc] init];;
      secondViewController = @"Second View";
      secondViewController = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemMostViewed tag:1];
      [tabItems addObject:secondViewController];
      self.tabBarController = [[UITabBarController alloc]init];
      self.tabBarController.viewControllers = tabItems;   
      self.tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
      [self presentModalViewController:tabBarController animated:YES];
}

UITabBarItem UITabBarSystemItemMostViewed example.
    ThirdViewController *thirdViewController = [[ThirdViewController alloc]init];
    thirdViewController.title = @"Third View";
    thirdViewController.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemMostViewed tag:2];
    UINavigationController *thirdNavController = [[UINavigationController alloc]initWithRootViewController:thirdViewController];

End of UITabBarItem UITabBarSystemItemMostViewed example article.

UITabBarItem UITabBarSystemItemMostRecent example in Objective C (iOS).

UITabBarItem UITabBarSystemItemMostRecent


UITabBarSystemItem
System items that can be used on a tab bar.

typedef enum {
UITabBarSystemItemMore,
UITabBarSystemItemFavorites,
UITabBarSystemItemFeatured,
UITabBarSystemItemTopRated,
UITabBarSystemItemRecents,
UITabBarSystemItemContacts,
UITabBarSystemItemHistory,
UITabBarSystemItemBookmarks,
UITabBarSystemItemSearch,
UITabBarSystemItemDownloads,
UITabBarSystemItemMostRecent,
UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

Constants
UITabBarSystemItemMore
The more system item.
UITabBarSystemItemFavorites
The favorites system item.
UITabBarSystemItemFeatured
The featured system item.
UITabBarSystemItemTopRated
The top rated system item.
UITabBarSystemItemRecents
The recents system item.
UITabBarSystemItemContacts
The contacts system item.
UITabBarSystemItemHistory
The history system item.
UITabBarSystemItemBookmarks
The bookmarks system item.
UITabBarSystemItemSearch
The search system item.
UITabBarSystemItemDownloads
The downloads system item.
UITabBarSystemItemMostRecent
The most recent system item.
UITabBarSystemItemMostViewed
The most viewed system item.

Discussion of [UITabBarItem UITabBarSystemItemMostRecent]
The title and image of system tab bar items cannot be changed.

UITabBarItem UITabBarSystemItemMostRecent example.
UITabBarItem *favorites = [[UITabBarItem alloc] initWithTitle:nil image:a1 tag:0];
UITabBarItem *bookmarks = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemBookmarks tag:1];
UITabBarItem *featured = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:2];
UITabBarItem *mostRecent = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemMostRecent tag:3];

Example of [UITabBarItem UITabBarSystemItemMostRecent].
//Create TabBar View here
-(void)createTabBarView
{
     NSMutableArray *tabItems = [NSMutableArray array];
     UIViewController *firstViewController = [[FirstViewController alloc] init];;
     firstViewController = @"First View";
     firstViewController = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemMostRecent tag:0];
      [tabItems addObject:firstViewController];
      UIViewController *secondViewController = [[SecondViewController alloc] init];;
      secondViewController = @"Second View";
      secondViewController = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemMostRecent tag:1];
      [tabItems addObject:secondViewController];
      self.tabBarController = [[UITabBarController alloc]init];
      self.tabBarController.viewControllers = tabItems;   
      self.tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
      [self presentModalViewController:tabBarController animated:YES];
}

UITabBarItem UITabBarSystemItemMostRecent example.
    ThirdViewController *thirdViewController = [[ThirdViewController alloc]init];
    thirdViewController.title = @"Third View";
    thirdViewController.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemMostRecent tag:2];
    UINavigationController *thirdNavController = [[UINavigationController alloc]initWithRootViewController:thirdViewController];

End of UITabBarItem UITabBarSystemItemMostRecent example article.

UITabBarItem UITabBarSystemItemDownloads example in Objective C (iOS).

UITabBarItem UITabBarSystemItemDownloads


UITabBarSystemItem
System items that can be used on a tab bar.

typedef enum {
UITabBarSystemItemMore,
UITabBarSystemItemFavorites,
UITabBarSystemItemFeatured,
UITabBarSystemItemTopRated,
UITabBarSystemItemRecents,
UITabBarSystemItemContacts,
UITabBarSystemItemHistory,
UITabBarSystemItemBookmarks,
UITabBarSystemItemSearch,
UITabBarSystemItemDownloads,
UITabBarSystemItemMostRecent,
UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

Constants
UITabBarSystemItemMore
The more system item.
UITabBarSystemItemFavorites
The favorites system item.
UITabBarSystemItemFeatured
The featured system item.
UITabBarSystemItemTopRated
The top rated system item.
UITabBarSystemItemRecents
The recents system item.
UITabBarSystemItemContacts
The contacts system item.
UITabBarSystemItemHistory
The history system item.
UITabBarSystemItemBookmarks
The bookmarks system item.
UITabBarSystemItemSearch
The search system item.
UITabBarSystemItemDownloads
The downloads system item.
UITabBarSystemItemMostRecent
The most recent system item.
UITabBarSystemItemMostViewed
The most viewed system item.

Discussion of [UITabBarItem UITabBarSystemItemDownloads]
The title and image of system tab bar items cannot be changed.

UITabBarItem UITabBarSystemItemDownloads example.
UITabBarItem *favorites = [[UITabBarItem alloc] initWithTitle:nil image:a1 tag:0];
UITabBarItem *bookmarks = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemBookmarks tag:1];
UITabBarItem *featured = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:2];
UITabBarItem *search = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemDownloads tag:3];

Example of [UITabBarItem UITabBarSystemItemDownloads].
//Create TabBar View here
-(void)createTabBarView
{
     NSMutableArray *tabItems = [NSMutableArray array];
     UIViewController *firstViewController = [[FirstViewController alloc] init];;
     firstViewController = @"First View";
     firstViewController = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemDownloads tag:0];
      [tabItems addObject:firstViewController];
      UIViewController *secondViewController = [[SecondViewController alloc] init];;
      secondViewController = @"Second View";
      secondViewController = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemDownloads tag:1];
      [tabItems addObject:secondViewController];
      self.tabBarController = [[UITabBarController alloc]init];
      self.tabBarController.viewControllers = tabItems;   
      self.tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
      [self presentModalViewController:tabBarController animated:YES];
}

UITabBarItem UITabBarSystemItemDownloads example.
    ThirdViewController *thirdViewController = [[ThirdViewController alloc]init];
    thirdViewController.title = @"Third View";
    thirdViewController.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemDownloads tag:2];
    UINavigationController *thirdNavController = [[UINavigationController alloc]initWithRootViewController:thirdViewController];

End of UITabBarItem UITabBarSystemItemDownloads example article.

UITabBarItem UITabBarSystemItemSearch example in Objective C (iOS).


UITabBarItem UITabBarSystemItemSearch

UITabBarSystemItem
System items that can be used on a tab bar.

typedef enum {
UITabBarSystemItemMore,
UITabBarSystemItemFavorites,
UITabBarSystemItemFeatured,
UITabBarSystemItemTopRated,
UITabBarSystemItemRecents,
UITabBarSystemItemContacts,
UITabBarSystemItemHistory,
UITabBarSystemItemBookmarks,
UITabBarSystemItemSearch,
UITabBarSystemItemDownloads,
UITabBarSystemItemMostRecent,
UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

Constants
UITabBarSystemItemMore
The more system item.
UITabBarSystemItemFavorites
The favorites system item.
UITabBarSystemItemFeatured
The featured system item.
UITabBarSystemItemTopRated
The top rated system item.
UITabBarSystemItemRecents
The recents system item.
UITabBarSystemItemContacts
The contacts system item.
UITabBarSystemItemHistory
The history system item.
UITabBarSystemItemBookmarks
The bookmarks system item.
UITabBarSystemItemSearch
The search system item.
UITabBarSystemItemDownloads
The downloads system item.
UITabBarSystemItemMostRecent
The most recent system item.
UITabBarSystemItemMostViewed
The most viewed system item.

Discussion of [UITabBarItem UITabBarSystemItemSearch]
The title and image of system tab bar items cannot be changed.

UITabBarItem UITabBarSystemItemSearch example.
UITabBarItem *favorites = [[UITabBarItem alloc] initWithTitle:nil image:a1 tag:0];
UITabBarItem *bookmarks = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemBookmarks tag:1];
UITabBarItem *featured = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:2];
UITabBarItem *search = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemSearch tag:3];

Example of [UITabBarItem UITabBarSystemItemSearch].
//Create TabBar View here
-(void)createTabBarView
{
     NSMutableArray *tabItems = [NSMutableArray array];
     UIViewController *firstViewController = [[FirstViewController alloc] init];;
     firstViewController = @"First View";
     firstViewController = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemSearch tag:0];
      [tabItems addObject:firstViewController];
      UIViewController *secondViewController = [[SecondViewController alloc] init];;
      secondViewController = @"Second View";
      secondViewController = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemSearch tag:1];
      [tabItems addObject:secondViewController];
      self.tabBarController = [[UITabBarController alloc]init];
      self.tabBarController.viewControllers = tabItems;   
      self.tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
      [self presentModalViewController:tabBarController animated:YES];
}

UITabBarItem UITabBarSystemItemSearch example.
    ThirdViewController *thirdViewController = [[ThirdViewController alloc]init];
    thirdViewController.title = @"Third View";
    thirdViewController.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemSearch tag:2];
    UINavigationController *thirdNavController = [[UINavigationController alloc]initWithRootViewController:thirdViewController];

End of UITabBarItem UITabBarSystemItemSearch example article.

UITabBarItem UITabBarSystemItemBookmarks example in Objective C (iOS).


UITabBarItem UITabBarSystemItemBookmarks

UITabBarSystemItem
System items that can be used on a tab bar.

typedef enum {
UITabBarSystemItemMore,
UITabBarSystemItemFavorites,
UITabBarSystemItemFeatured,
UITabBarSystemItemTopRated,
UITabBarSystemItemRecents,
UITabBarSystemItemContacts,
UITabBarSystemItemHistory,
UITabBarSystemItemBookmarks,
UITabBarSystemItemSearch,
UITabBarSystemItemDownloads,
UITabBarSystemItemMostRecent,
UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

Constants
UITabBarSystemItemMore
The more system item.
UITabBarSystemItemFavorites
The favorites system item.
UITabBarSystemItemFeatured
The featured system item.
UITabBarSystemItemTopRated
The top rated system item.
UITabBarSystemItemRecents
The recents system item.
UITabBarSystemItemContacts
The contacts system item.
UITabBarSystemItemHistory
The history system item.
UITabBarSystemItemBookmarks
The bookmarks system item.
UITabBarSystemItemSearch
The search system item.
UITabBarSystemItemDownloads
The downloads system item.
UITabBarSystemItemMostRecent
The most recent system item.
UITabBarSystemItemMostViewed
The most viewed system item.

Discussion of [UITabBarItem UITabBarSystemItemBookmarks]
The title and image of system tab bar items cannot be changed.

UITabBarItem UITabBarSystemItemBookmarks example.
UITabBarItem *favorites = [[UITabBarItem alloc] initWithTitle:nil image:a1 tag:0];
UITabBarItem *bookmarks = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemBookmarks tag:1];
UITabBarItem *featured = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:2];
UITabBarItem *contacts = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemContacts tag:3];

Example of [UITabBarItem UITabBarSystemItemBookmarks].
//Create TabBar View here
-(void)createTabBarView
{
     NSMutableArray *tabItems = [NSMutableArray array];
     UIViewController *firstViewController = [[FirstViewController alloc] init];;
     firstViewController = @"First View";
     firstViewController = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemBookmarks tag:0];
      [tabItems addObject:firstViewController];
      UIViewController *secondViewController = [[SecondViewController alloc] init];;
      secondViewController = @"Second View";
      secondViewController = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemBookmarks tag:1];
      [tabItems addObject:secondViewController];
      self.tabBarController = [[UITabBarController alloc]init];
      self.tabBarController.viewControllers = tabItems;   
      self.tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
      [self presentModalViewController:tabBarController animated:YES];
}

UITabBarItem UITabBarSystemItemBookmarks example.
    ThirdViewController *thirdViewController = [[ThirdViewController alloc]init];
    thirdViewController.title = @"Third View";
    thirdViewController.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemBookmarks tag:2];
    UINavigationController *thirdNavController = [[UINavigationController alloc]initWithRootViewController:thirdViewController];

End of UITabBarItem UITabBarSystemItemBookmarks example article.

UITabBarItem UITabBarSystemItemHistory example in Objective C (iOS).


UITabBarItem UITabBarSystemItemHistory

UITabBarSystemItem
System items that can be used on a tab bar.

typedef enum {
UITabBarSystemItemMore,
UITabBarSystemItemFavorites,
UITabBarSystemItemFeatured,
UITabBarSystemItemTopRated,
UITabBarSystemItemRecents,
UITabBarSystemItemContacts,
UITabBarSystemItemHistory,
UITabBarSystemItemBookmarks,
UITabBarSystemItemSearch,
UITabBarSystemItemDownloads,
UITabBarSystemItemMostRecent,
UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

Constants
UITabBarSystemItemMore
The more system item.
UITabBarSystemItemFavorites
The favorites system item.
UITabBarSystemItemFeatured
The featured system item.
UITabBarSystemItemTopRated
The top rated system item.
UITabBarSystemItemRecents
The recents system item.
UITabBarSystemItemContacts
The contacts system item.
UITabBarSystemItemHistory
The history system item.
UITabBarSystemItemBookmarks
The bookmarks system item.
UITabBarSystemItemSearch
The search system item.
UITabBarSystemItemDownloads
The downloads system item.
UITabBarSystemItemMostRecent
The most recent system item.
UITabBarSystemItemMostViewed
The most viewed system item.

Discussion of [UITabBarItem UITabBarSystemItemHistory]
The title and image of system tab bar items cannot be changed.

UITabBarItem UITabBarSystemItemHistory example.
UITabBarItem *favorites = [[UITabBarItem alloc] initWithTitle:nil image:a1 tag:0];
UITabBarItem *history = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemHistory tag:1];
UITabBarItem *featured = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:2];
UITabBarItem *contacts = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemContacts tag:3];

Example of [UITabBarItem UITabBarSystemItemHistory].
//Create TabBar View here
-(void)createTabBarView
{
     NSMutableArray *tabItems = [NSMutableArray array];
     UIViewController *firstViewController = [[FirstViewController alloc] init];;
     firstViewController = @"First View";
     firstViewController = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemHistory tag:0];
      [tabItems addObject:firstViewController];
      UIViewController *secondViewController = [[SecondViewController alloc] init];;
      secondViewController = @"Second View";
      secondViewController = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemHistory tag:1];
      [tabItems addObject:secondViewController];
      self.tabBarController = [[UITabBarController alloc]init];
      self.tabBarController.viewControllers = tabItems;   
      self.tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
      [self presentModalViewController:tabBarController animated:YES];
}

UITabBarItem UITabBarSystemItemHistory example.
    ThirdViewController *thirdViewController = [[ThirdViewController alloc]init];
    thirdViewController.title = @"Third View";
    thirdViewController.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemHistory tag:2];
    UINavigationController *thirdNavController = [[UINavigationController alloc]initWithRootViewController:thirdViewController];

End of UITabBarItem UITabBarSystemItemHistory example article.

UITabBarItem UITabBarSystemItemContacts example in Objective C (iOS).


UITabBarItem UITabBarSystemItemContacts

UITabBarSystemItem
System items that can be used on a tab bar.

typedef enum {
UITabBarSystemItemMore,
UITabBarSystemItemFavorites,
UITabBarSystemItemFeatured,
UITabBarSystemItemTopRated,
UITabBarSystemItemRecents,
UITabBarSystemItemContacts,
UITabBarSystemItemHistory,
UITabBarSystemItemBookmarks,
UITabBarSystemItemSearch,
UITabBarSystemItemDownloads,
UITabBarSystemItemMostRecent,
UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

Constants
UITabBarSystemItemMore
The more system item.
UITabBarSystemItemFavorites
The favorites system item.
UITabBarSystemItemFeatured
The featured system item.
UITabBarSystemItemTopRated
The top rated system item.
UITabBarSystemItemRecents
The recents system item.
UITabBarSystemItemContacts
The contacts system item.
UITabBarSystemItemHistory
The history system item.
UITabBarSystemItemBookmarks
The bookmarks system item.
UITabBarSystemItemSearch
The search system item.
UITabBarSystemItemDownloads
The downloads system item.
UITabBarSystemItemMostRecent
The most recent system item.
UITabBarSystemItemMostViewed
The most viewed system item.

Discussion of [UITabBarItem UITabBarSystemItemContacts]
The title and image of system tab bar items cannot be changed.

UITabBarItem UITabBarSystemItemContacts example.
UITabBarItem *favorites = [[UITabBarItem alloc] initWithTitle:nil image:a1 tag:0];
UITabBarItem *topRated = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemTopRated tag:1];
UITabBarItem *featured = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:2];
UITabBarItem *contacts = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemContacts tag:3];

Example of [UITabBarItem UITabBarSystemItemContacts].
//Create TabBar View here
-(void)createTabBarView
{
     NSMutableArray *tabItems = [NSMutableArray array];
     UIViewController *firstViewController = [[FirstViewController alloc] init];;
     firstViewController = @"First View";
     firstViewController = [[UITabBarItem alloc]initWithTabBarSystemItem:UITabBarSystemItemContacts tag:0];
      [tabItems addObject:firstViewController];
      UIViewController *secondViewController = [[SecondViewController alloc] init];;
      secondViewController = @"Second View";
      secondViewController = [[UITabBarItem alloc]initWithTabBarSystemItem:UITabBarSystemItemContacts tag:1];
      [tabItems addObject:secondViewController];
      self.tabBarController = [[UITabBarController alloc]init];
      self.tabBarController.viewControllers = tabItems;   
      self.tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
      [self presentModalViewController:tabBarController animated:YES];
}

UITabBarItem UITabBarSystemItemContacts example.
    ThirdViewController *thirdViewController = [[ThirdViewController alloc]init];
    thirdViewController.title = @"Third View";
    thirdViewController.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem: UITabBarSystemItemContacts tag:2];
    UINavigationController *thirdNavController = [[UINavigationController alloc]initWithRootViewController:thirdViewController];

End of UITabBarItem UITabBarSystemItemContacts example article.

UITabBarItem UITabBarSystemItemRecents example in Objective C (iOS).


UITabBarItem UITabBarSystemItemRecents

UITabBarSystemItem
System items that can be used on a tab bar.

typedef enum {
UITabBarSystemItemMore,
UITabBarSystemItemFavorites,
UITabBarSystemItemFeatured,
UITabBarSystemItemTopRated,
UITabBarSystemItemRecents,
UITabBarSystemItemContacts,
UITabBarSystemItemHistory,
UITabBarSystemItemBookmarks,
UITabBarSystemItemSearch,
UITabBarSystemItemDownloads,
UITabBarSystemItemMostRecent,
UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

Constants
UITabBarSystemItemMore
The more system item.
UITabBarSystemItemFavorites
The favorites system item.
UITabBarSystemItemFeatured
The featured system item.
UITabBarSystemItemTopRated
The top rated system item.
UITabBarSystemItemRecents
The recents system item.
UITabBarSystemItemContacts
The contacts system item.
UITabBarSystemItemHistory
The history system item.
UITabBarSystemItemBookmarks
The bookmarks system item.
UITabBarSystemItemSearch
The search system item.
UITabBarSystemItemDownloads
The downloads system item.
UITabBarSystemItemMostRecent
The most recent system item.
UITabBarSystemItemMostViewed
The most viewed system item.

Discussion of [UITabBarItem UITabBarSystemItemRecents]
The title and image of system tab bar items cannot be changed.

UITabBarItem UITabBarSystemItemRecents example.
UITabBarItem *favorites = [[UITabBarItem alloc] initWithTitle:nil image:a1 tag:0];
UITabBarItem *topRated = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemTopRated tag:1];
UITabBarItem *featured = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:2];
UITabBarItem *recents = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemRecents tag:3];

Example of [UITabBarItem UITabBarSystemItemRecents].
UITabBarItem *barItem = [[UITabBarItem] alloc] initWithTabBarSystemItem: UITabBarSystemItemRecents tag:0];
self.tabBarItem = [barItem autorelease]; //of not using ARC

UITabBarItem UITabBarSystemItemRecents example.
    ThirdViewController *thirdViewController = [[ThirdViewController alloc]init];
    thirdViewController.title = @"Third View";
    thirdViewController.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem:UITabBarSystemItemRecents tag:2];
    UINavigationController *thirdNavController = [[UINavigationController alloc]initWithRootViewController:thirdViewController];

End of UITabBarItem UITabBarSystemItemRecents example article.

UITabBarItem UITabBarSystemItemTopRated example in Objective C (iOS).


UITabBarItem UITabBarSystemItemTopRated

UITabBarSystemItem
System items that can be used on a tab bar.

typedef enum {
UITabBarSystemItemMore,
UITabBarSystemItemFavorites,
UITabBarSystemItemFeatured,
UITabBarSystemItemTopRated,
UITabBarSystemItemRecents,
UITabBarSystemItemContacts,
UITabBarSystemItemHistory,
UITabBarSystemItemBookmarks,
UITabBarSystemItemSearch,
UITabBarSystemItemDownloads,
UITabBarSystemItemMostRecent,
UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

Constants
UITabBarSystemItemMore
The more system item.
UITabBarSystemItemFavorites
The favorites system item.
UITabBarSystemItemFeatured
The featured system item.
UITabBarSystemItemTopRated
The top rated system item.
UITabBarSystemItemRecents
The recents system item.
UITabBarSystemItemContacts
The contacts system item.
UITabBarSystemItemHistory
The history system item.
UITabBarSystemItemBookmarks
The bookmarks system item.
UITabBarSystemItemSearch
The search system item.
UITabBarSystemItemDownloads
The downloads system item.
UITabBarSystemItemMostRecent
The most recent system item.
UITabBarSystemItemMostViewed
The most viewed system item.

Discussion of [UITabBarItem UITabBarSystemItemTopRated]
The title and image of system tab bar items cannot be changed.

UITabBarItem UITabBarSystemItemTopRated example.
UITabBarItem *favorites = [[UITabBarItem alloc] initWithTitle:nil image:a1 tag:0];
UITabBarItem *topRated = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemTopRated tag:1];
UITabBarItem *featured = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:2];
UITabBarItem *recents = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemRecents tag:3];

Example of [UITabBarItem UITabBarSystemItemTopRated].
UITabBarItem *barItem = [[UITabBarItem] alloc] initWithTabBarSystemItem: UITabBarSystemItemTopRated tag:0];
self.tabBarItem = [barItem autorelease]; //of not using ARC

UITabBarItem UITabBarSystemItemTopRated example.
    UITabBarItem *otherContactsTabBarItem =
    [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemTopRated tag:1];
    otherContactsBarItem.title = @"My Contacts";
    otherContactsView.tabBarItem = otherContactsBarItem;
    [otherContactsBarItem release];

End of UITabBarItem UITabBarSystemItemTopRated example article.

UITabBarItem UITabBarSystemItemFeatured example in Objective C (iOS).


UITabBarItem UITabBarSystemItemFeatured

UITabBarSystemItem
System items that can be used on a tab bar.

typedef enum {
UITabBarSystemItemMore,
UITabBarSystemItemFavorites,
UITabBarSystemItemFeatured,
UITabBarSystemItemTopRated,
UITabBarSystemItemRecents,
UITabBarSystemItemContacts,
UITabBarSystemItemHistory,
UITabBarSystemItemBookmarks,
UITabBarSystemItemSearch,
UITabBarSystemItemDownloads,
UITabBarSystemItemMostRecent,
UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

Constants
UITabBarSystemItemMore
The more system item.
UITabBarSystemItemFavorites
The favorites system item.
UITabBarSystemItemFeatured
The featured system item.
UITabBarSystemItemTopRated
The top rated system item.
UITabBarSystemItemRecents
The recents system item.
UITabBarSystemItemContacts
The contacts system item.
UITabBarSystemItemHistory
The history system item.
UITabBarSystemItemBookmarks
The bookmarks system item.
UITabBarSystemItemSearch
The search system item.
UITabBarSystemItemDownloads
The downloads system item.
UITabBarSystemItemMostRecent
The most recent system item.
UITabBarSystemItemMostViewed
The most viewed system item.

Discussion of [UITabBarItem UITabBarSystemItemFeatured]
The title and image of system tab bar items cannot be changed.

UITabBarItem UITabBarSystemItemFeatured example.
UITabBarItem *favorites = [[UITabBarItem alloc] initWithTitle:nil image:a1 tag:0];
UITabBarItem *topRated = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemTopRated tag:1];
UITabBarItem *featured = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:2];
UITabBarItem *recents = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemRecents tag:3];

Example of [UITabBarItem UITabBarSystemItemFeatured].
UITabBarController *tabBarController = [[UITabBarController alloc] init];
[tabBarController setViewControllers:[NSArray arraywithObjects: firstViewController, secondViewController, nil]
                            animated:NO];
And to set the tab bar items:

firstViewController.tabBarItem = [UITabBarItem initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:0];
secondViewController.tabBarItem = [UITabBarItem initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:1];

UITabBarItem UITabBarSystemItemFeatured example.
- (void)setNewItems {
    UITabBarItem *featured = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:0]; featured.badgeValue = @"1";
    UITabBarItem *mostViewed = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMostViewed tag:1];
    UITabBarItem *search = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemSearch tag:2];
    UITabBarItem *favorites = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:3];
    UITabBarItem *more = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMore tag:4];

    [self.tabBar setItems:[NSArray arrayWithObjects:featured,
                           mostViewed,
                           search,
                           favorites,
                           more, nil] animated:NO];

}

End of UITabBarItem UITabBarSystemItemFeatured example article.

UITabBarItem UITabBarSystemItemFavorites example in Objective C (iOS).


UITabBarItem UITabBarSystemItemFavorites

UITabBarSystemItem
System items that can be used on a tab bar.

typedef enum {
UITabBarSystemItemMore,
UITabBarSystemItemFavorites,
UITabBarSystemItemFeatured,
UITabBarSystemItemTopRated,
UITabBarSystemItemRecents,
UITabBarSystemItemContacts,
UITabBarSystemItemHistory,
UITabBarSystemItemBookmarks,
UITabBarSystemItemSearch,
UITabBarSystemItemDownloads,
UITabBarSystemItemMostRecent,
UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

Constants
UITabBarSystemItemMore
The more system item.
UITabBarSystemItemFavorites
The favorites system item.
UITabBarSystemItemFeatured
The featured system item.
UITabBarSystemItemTopRated
The top rated system item.
UITabBarSystemItemRecents
The recents system item.
UITabBarSystemItemContacts
The contacts system item.
UITabBarSystemItemHistory
The history system item.
UITabBarSystemItemBookmarks
The bookmarks system item.
UITabBarSystemItemSearch
The search system item.
UITabBarSystemItemDownloads
The downloads system item.
UITabBarSystemItemMostRecent
The most recent system item.
UITabBarSystemItemMostViewed
The most viewed system item.

Discussion of [UITabBarItem UITabBarSystemItemFavorites]
The title and image of system tab bar items cannot be changed.

UITabBarItem UITabBarSystemItemFavorites example.
UITabBarController *tabBarController = [[UITabBarController alloc] init];
[tabBarController setViewControllers:[NSArray arraywithObjects: firstViewController, secondViewController, nil]
                            animated:NO];
And to set the tab bar items:

firstViewController.tabBarItem = [UITabBarItem initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:0];
secondViewController.tabBarItem = [UITabBarItem initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:1];

Example of [UITabBarItem UITabBarSystemItemFavorites].
        self.title = NSLocalizedString(@"Liked", @"Liked");
        self.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:0];
        self.tabBarItem.title = @"Liked";

UITabBarItem UITabBarSystemItemFavorites example.
to hide the above black bar use -

[self.navigationController setNavigationBarHidden:TRUE];
to set tab bar item use -

for system item -

UITabBarItem *firstItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:0];
for custom item -

UITabBarItem *firstItem = [[UITabBarItem alloc] initWithTitle:@"title" image:[UIImage imageNamed:@""] tag:0];

[navController setTabBarItem:firstItem];

End of UITabBarItem UITabBarSystemItemFavorites example article.

UITabBarItem UITabBarSystemItemMore example in Objective C (iOS).


UITabBarItem UITabBarSystemItemMore

UITabBarSystemItem
System items that can be used on a tab bar.

typedef enum {
UITabBarSystemItemMore,
UITabBarSystemItemFavorites,
UITabBarSystemItemFeatured,
UITabBarSystemItemTopRated,
UITabBarSystemItemRecents,
UITabBarSystemItemContacts,
UITabBarSystemItemHistory,
UITabBarSystemItemBookmarks,
UITabBarSystemItemSearch,
UITabBarSystemItemDownloads,
UITabBarSystemItemMostRecent,
UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

Constants
UITabBarSystemItemMore
The more system item.
UITabBarSystemItemFavorites
The favorites system item.
UITabBarSystemItemFeatured
The featured system item.
UITabBarSystemItemTopRated
The top rated system item.
UITabBarSystemItemRecents
The recents system item.
UITabBarSystemItemContacts
The contacts system item.
UITabBarSystemItemHistory
The history system item.
UITabBarSystemItemBookmarks
The bookmarks system item.
UITabBarSystemItemSearch
The search system item.
UITabBarSystemItemDownloads
The downloads system item.
UITabBarSystemItemMostRecent
The most recent system item.
UITabBarSystemItemMostViewed
The most viewed system item.

Discussion of [UITabBarItem UITabBarSystemItemMore]
The title and image of system tab bar items cannot be changed.

UITabBarItem UITabBarSystemItemMore example.
UITabBarItem *barItem = [[UITabBarItem] alloc] initWithTabBarSystemItem:UITabBarSystemItemMore tag:0];
self.tabBarItem = [barItem autorelease]; //of not using ARC

Example of [UITabBarItem UITabBarSystemItemMore].
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.tabBarController = [[UITabBarController alloc] init];

    // Initialize view controllers
    HomeViewController *homeViewController = [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil];
    ConnectViewController *connectViewController = [[ConnectViewController alloc] initWithNibName:@"ConnectViewController" bundle:nil];
    PartyControlViewController *partyControlViewController = [[PartyControlViewController alloc] initWithNibName:@"PartyControlViewController" bundle:nil];
    MeViewController *meViewController = [[MeViewController alloc] initWithNibName:@"MeViewController" bundle:nil];
    MoreViewController *moreViewController = [[MoreViewController alloc] initWithNibName:@"MoreViewController" bundle:nil];

    [self.tabBarController setViewControllers:[NSArray arrayWithObjects:homeViewController, connectViewController, partyControlViewController, meViewController, moreViewController, nil]];

    // Customize Tab Bar
    UITabBarItem *homeTab = [[UITabBarItem alloc] initWithTitle:@"Home" image:nil tag:0];
    UITabBarItem *connectTab = [[UITabBarItem alloc] initWithTitle:@"Connect" image:nil tag:1];
    UITabBarItem *partyControlTab = [[UITabBarItem alloc] initWithTitle:@"Party Control" image:nil tag:2];
    UITabBarItem *meTab = [[UITabBarItem alloc] initWithTitle:@"Me" image:[UIImage imageNamed:@"person.png"] tag:3];
    UITabBarItem *moreTab = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMore tag:4];

    [homeViewController setTabBarItem:homeTab];
    [connectViewController setTabBarItem:connectTab];
    [partyControlViewController setTabBarItem:partyControlTab];
    [meViewController setTabBarItem:meTab];
    [moreViewController setTabBarItem:moreTab];

    self.window.rootViewController = self.tabBarController;
}

UITabBarItem UITabBarSystemItemMore example.
- (void)setNewItems {
    UITabBarItem *featured = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:0]; featured.badgeValue = @"1";
    UITabBarItem *mostViewed = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMostViewed tag:1];
    UITabBarItem *search = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemSearch tag:2];
    UITabBarItem *favorites = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:3];
    UITabBarItem *more = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMore tag:4];

    [self.tabBar setItems:[NSArray arrayWithObjects:featured,
                           mostViewed,
                           search,
                           favorites,
                           more, nil] animated:NO];

}

End of UITabBarItem UITabBarSystemItemMore example article.

UITabBarItem titlePositionAdjustment example in Objective C (iOS).


UITabBarItem titlePositionAdjustment

Returns the offset to use to adjust the title position.

- (UIOffset)titlePositionAdjustment

Return Value of [UITabBarItem titlePositionAdjustment]
The offset to use to adjust the title position.

UITabBarItem titlePositionAdjustment example.
verticalOffset = UIOffset.new(0, -4)

self.tabBarItem = UITabBarItem.alloc.initWithTitle('First', image: nil, tag: 0)
self.tabBarItem.setFinishedSelectedImage(tabSelected, withFinishedUnselectedImage: tabNormal)
self.tabBarItem.setTitlePositionAdjustment(verticalOffset)

Example of [UITabBarItem titlePositionAdjustment].
UITabBar *tabBar = self.tabBarController.tabBar;

 UITabBarItem *item0 = [tabBar.items objectAtIndex:0];

 item0.titlePositionAdjustment = UIOffsetMake(10, 5);

UITabBarItem titlePositionAdjustment example.
 self.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Home" image:nil tag:0];
        [[self tabBarItem] setFinishedSelectedImage:[UIImage imageNamed:@"Home_icon"]
                        withFinishedUnselectedImage:[UIImage imageNamed:@"Home_icon_selected"]];
        // move text up
        self.tabBarItem.titlePositionAdjustment = UIOffsetMake(0.0, -4.0);
        // set color for text
        [[self tabBarItem] setTitleTextAttributes:@{
                         UITextAttributeTextColor:[UIColor colorWithRed:0.253 green:0.243 blue:0.226 alpha:1.000],
                              NSFontAttributeName:LCFontStyleNTabBarText}
                                         forState:UIControlStateNormal];
        [[self tabBarItem] setTitleTextAttributes:@{
                         UITextAttributeTextColor:[UIColor whiteColor],
                              NSFontAttributeName:LCFontStyleNTabBarText}
                                         forState:UIControlStateSelected];

End of UITabBarItem titlePositionAdjustment example article.

UITabBarItem setTitlePositionAdjustment example in Objective C (iOS).


UITabBarItem setTitlePositionAdjustment

Sets the offset to use to adjust the title position.

- (void)setTitlePositionAdjustment:(UIOffset)adjustment

Parameters of [UITabBarItem setTitlePositionAdjustment]
adjustment
The offset to use to adjust the title position.

UITabBarItem setTitlePositionAdjustment example.
verticalOffset = UIOffset.new(0, -4)

self.tabBarItem = UITabBarItem.alloc.initWithTitle('First', image: nil, tag: 0)
self.tabBarItem.setFinishedSelectedImage(tabSelected, withFinishedUnselectedImage: tabNormal)
self.tabBarItem.setTitlePositionAdjustment(verticalOffset)

Example of [UITabBarItem setTitlePositionAdjustment].
[tab.tabBarItem setTitlePositionAdjustment:UIOffsetMake(0, -10)]


UITabBarItem setTitlePositionAdjustment example.
Got it!

[tab.tabBarItem setTitlePositionAdjustment:UIOffsetMake(0, -10)]


End of UITabBarItem setTitlePositionAdjustment example article.

UITabBarItem setFinishedSelectedImage example in Objective C (iOS).


UITabBarItem setFinishedSelectedImage

Sets the finished selected and unselected images.

- (void)setFinishedSelectedImage:(UIImage *)selectedImage withFinishedUnselectedImage:(UIImage *)unselectedImage

Parameters of [UITabBarItem setFinishedSelectedImage]
selectedImage
The finished selected image.
unselectedImage
The finished unselected image.

UITabBarItem setFinishedSelectedImage example.
You should initialize the tab bar item with initWithTitle:image:tag:.

UITabBarItem *vc1i = [[UITabBarItem alloc] initWithTitle:@"Top Rated" image:nil tag:100];
[vc1i setFinishedSelectedImage:[UIImage imageNamed:@"tab_bar_item_selected.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"tab_bar_item_normal.png"]];

Example of [UITabBarItem setFinishedSelectedImage].
UIImage *selectedImage = [UIImage imageNamed:@"selected.png"];
UIImage *unselectedImage = [UIImage imageNamed:@"unselected.png"];

UITabBar *tabBar = tabBarViewController.tabBar;
UITabBarItem *item1 = [tabBar.items objectAtIndex:0];
[item1 setFinishedSelectedImage:selectedImage withFinishedUnselectedImage:unselectedImage];

UITabBarItem setFinishedSelectedImage example.
if ([[tabBarController.tabBar.items objectAtIndex:0] respondsToSelector:@selector(setFinishedSelectedImage:withFinishedUnselectedImage:)]) {

  [[tabBarController.tabBar.items objectAtIndex:0] setFinishedSelectedImage:[UIImage imageNamed:@"blabla1.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"bleble1.png"]];
  [[tabBarController.tabBar.items objectAtIndex:1] setFinishedSelectedImage:[UIImage imageNamed:@"blabla2.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"bleble2.png"]];
  [[tabBarController.tabBar.items objectAtIndex:2] setFinishedSelectedImage:[UIImage imageNamed:@"blabla3.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"bleble3.png"]];
  [[tabBarController.tabBar.items objectAtIndex:3] setFinishedSelectedImage:[UIImage imageNamed:@"blabla4.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"bleble4.png"]];

}

End of UITabBarItem setFinishedSelectedImage example article.

UITabBarItem initWithTitle image tag example in Objective C (iOS).


UITabBarItem initWithTitle image tag

Creates and returns a new item using the specified properties.

- (id)initWithTitle:(NSString *)title image:(UIImage *)image tag:(NSInteger)tag

Parameters of [UITabBarItem initWithTitle image tag]
title
The item’s title. If nil, a title is not displayed.
image
The item’s image. If nil, an image is not displayed.
The images displayed on the tab bar are derived from this image. The alpha values in the source image are used to create the unselected and selected images—opaque values are ignored. If this image is too large to fit on the tab bar, it is clipped to fit. The size of a tab bar image is typically 60 x 60 pixels. See “Custom Icon and Image Creation Guidelines” for more information about tab bar icons.
tag
The receiver’s tag, an integer that you can use to identify bar item objects in your application.

Return Value of [UITabBarItem initWithTitle image tag]
Newly initialized item with the specified properties.

UITabBarItem initWithTitle image tag example.
Something like this

-(void)viewDidLoad {
    [super viewDidLoad];
    UITabBarItem *tbi = [[UITabBarItem alloc] initWithTitle:yourTitle image:yourIcon tag:yourTag];
    [self setTabBarItem:tbi]
    [tbi release];
}

Example of [UITabBarItem initWithTitle image tag].
You can do this by creating the items you want for your tab bar, adding them to an array, and then calling the UITabBar method setItems:animated:

UITabBarItem *firstItem = [UITabBarItem initWithTitle:@"First" image:firstImage tag:1];
UITabBarItem *secondItem = [UITabBarItem initWithTitle:@"Second" image:secondImage tag:2];

NSArray *itemsArray = [NSArray arrayWithItems:firstItem, secondItem, nil];

[myTabBar setItems:itemsArray animated:YES];

UITabBarItem initWithTitle image tag example.
yourViewController.tabBarItem = [[UITabBarItem alloc]
initWithTitle:NSLocalizedString(@"Name", @"Name")
image:[UIImage imageNamed:@"tab_ yourViewController.png"]
tag:3];
The viewControllers are added to the tab bar, so the image and names should be set before the tab bar becomes visible (appDelegate if they are there on app start for instance). After that, you could use the above code to change the icon and text from the loadView or viewDidAppear within that viewController.

End of UITabBarItem initWithTitle image tag example article.

UITabBarItem initWithTitle example in Objective C (iOS).


UITabBarItem initWithTitle

Creates and returns a new item using the specified properties.

- (id)initWithTitle:(NSString *)title image:(UIImage *)image tag:(NSInteger)tag

Parameters of [UITabBarItem initWithTitle]
title
The item’s title. If nil, a title is not displayed.
image
The item’s image. If nil, an image is not displayed.
The images displayed on the tab bar are derived from this image. The alpha values in the source image are used to create the unselected and selected images—opaque values are ignored. If this image is too large to fit on the tab bar, it is clipped to fit. The size of a tab bar image is typically 60 x 60 pixels. See “Custom Icon and Image Creation Guidelines” for more information about tab bar icons.
tag
The receiver’s tag, an integer that you can use to identify bar item objects in your application.

Return Value of [UITabBarItem initWithTitle]
Newly initialized item with the specified properties.

UITabBarItem initWithTitle example.
Something like this

-(void)viewDidLoad {
    [super viewDidLoad];
    UITabBarItem *tbi = [[UITabBarItem alloc] initWithTitle:yourTitle image:yourIcon tag:yourTag];
    [self setTabBarItem:tbi]
    [tbi release];
}

Example of [UITabBarItem initWithTitle].
You can do this by creating the items you want for your tab bar, adding them to an array, and then calling the UITabBar method setItems:animated:

UITabBarItem *firstItem = [UITabBarItem initWithTitle:@"First" image:firstImage tag:1];
UITabBarItem *secondItem = [UITabBarItem initWithTitle:@"Second" image:secondImage tag:2];

NSArray *itemsArray = [NSArray arrayWithItems:firstItem, secondItem, nil];

[myTabBar setItems:itemsArray animated:YES];

UITabBarItem initWithTitle example.
yourViewController.tabBarItem = [[UITabBarItem alloc]
initWithTitle:NSLocalizedString(@"Name", @"Name")
image:[UIImage imageNamed:@"tab_ yourViewController.png"]
tag:3];
The viewControllers are added to the tab bar, so the image and names should be set before the tab bar becomes visible (appDelegate if they are there on app start for instance). After that, you could use the above code to change the icon and text from the loadView or viewDidAppear within that viewController.

End of UITabBarItem initWithTitle example article.

UITabBarItem initWithTabBarSystemItem tag example in Objective C (iOS).


UITabBarItem initWithTabBarSystemItem tag

Creates and returns a new item containing the specified system item.

- (id)initWithTabBarSystemItem:(UITabBarSystemItem)systemItem tag:(NSInteger)tag

Parameters of [UITabBarItem initWithTabBarSystemItem tag]
systemItem
The system item to use as the first item on the tab bar. One of the constants defined in UITabBarSystemItem.
tag
The receiver’s tag, an integer that you can use to identify bar item objects in your application.

Return Value
A newly initialized item containing the specified system item. The item’s target is nil.

Discussion of [UITabBarItem initWithTabBarSystemItem tag]
This method returns a system-supplied tab bar item. The title and image properties of the returned item cannot be changed later.

UITabBarItem initWithTabBarSystemItem tag example.
UITabBarController * tabBarController = [[UITabBarController alloc] init];

UIViewController * viewController1 = [[YourViewController alloc] init];
UIViewController * viewController2 = [[YourOtherViewController alloc] init];

viewController1.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMostViewed tag:0];
viewController2.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMostViewed tag:1];

tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil];

Example of [UITabBarItem initWithTabBarSystemItem tag].
        self.title = NSLocalizedString(@"Liked", @"Liked");
        self.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:0];
        self.tabBarItem.title = @"Liked";

UITabBarItem initWithTabBarSystemItem tag example.
it's easy to programatically create a tab bar controller:

UITabBarController *tabBarController = [[UITabBarController alloc] init];
[tabBarController setViewControllers:[NSArray arraywithObjects: firstViewController, secondViewController, nil]
                            animated:NO];
And to set the tab bar items:

firstViewController.tabBarItem = [UITabBarItem initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:0];
secondViewController.tabBarItem = [UITabBarItem initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:1];
Then just do whatever you need to do with tabBarController: present it modally (shudder), push it onto a navigation controller (oh god, the humanity), or whatever.

End of UITabBarItem initWithTabBarSystemItem tag example article.

UITabBarItem initWithTabBarSystemItem example in Objective C (iOS).


UITabBarItem initWithTabBarSystemItem

Creates and returns a new item containing the specified system item.

- (id)initWithTabBarSystemItem:(UITabBarSystemItem)systemItem tag:(NSInteger)tag

Parameters
systemItem
The system item to use as the first item on the tab bar. One of the constants defined in UITabBarSystemItem.
tag
The receiver’s tag, an integer that you can use to identify bar item objects in your application.

Return Value
A newly initialized item containing the specified system item. The item’s target is nil.

Discussion of [UITabBarItem initWithTabBarSystemItem]
This method returns a system-supplied tab bar item. The title and image properties of the returned item cannot be changed later.

UITabBarItem initWithTabBarSystemItem example.
UITabBarController * tabBarController = [[UITabBarController alloc] init];

UIViewController * viewController1 = [[YourViewController alloc] init];
UIViewController * viewController2 = [[YourOtherViewController alloc] init];

viewController1.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMostViewed tag:0];
viewController2.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMostViewed tag:1];

tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil];

Example of [UITabBarItem initWithTabBarSystemItem].
        self.title = NSLocalizedString(@"Liked", @"Liked");
        self.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:0];
        self.tabBarItem.title = @"Liked";

UITabBarItem initWithTabBarSystemItem example.
it's easy to programatically create a tab bar controller:

UITabBarController *tabBarController = [[UITabBarController alloc] init];
[tabBarController setViewControllers:[NSArray arraywithObjects: firstViewController, secondViewController, nil]
                            animated:NO];
And to set the tab bar items:

firstViewController.tabBarItem = [UITabBarItem initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:0];
secondViewController.tabBarItem = [UITabBarItem initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:1];
Then just do whatever you need to do with tabBarController: present it modally (shudder), push it onto a navigation controller (oh god, the humanity), or whatever.

End of UITabBarItem initWithTabBarSystemItem example article.

UITabBarItem finishedUnselectedImage example in Objective C (iOS).


UITabBarItem finishedUnselectedImage

Returns the finished unselected image.

- (UIImage *)finishedUnselectedImage

Return Value of [UITabBarItem finishedUnselectedImage]
The finished unselected image.

UITabBarItem finishedUnselectedImage example.
You have to specify the images for every tab item. The following code is working for me

if ([[tabBarController.tabBar.items objectAtIndex:0] respondsToSelector:@selector(setFinishedSelectedImage:withFinishedUnselectedImage:)]) {

  [[tabBarController.tabBar.items objectAtIndex:0] setFinishedSelectedImage:[UIImage imageNamed:@"blabla1.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"bleble1.png"]];
  [[tabBarController.tabBar.items objectAtIndex:1] setFinishedSelectedImage:[UIImage imageNamed:@"blabla2.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"bleble2.png"]];
  [[tabBarController.tabBar.items objectAtIndex:2] setFinishedSelectedImage:[UIImage imageNamed:@"blabla3.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"bleble3.png"]];
  [[tabBarController.tabBar.items objectAtIndex:3] setFinishedSelectedImage:[UIImage imageNamed:@"blabla4.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"bleble4.png"]];

}

Example of [UITabBarItem finishedUnselectedImage].
There is a property on UIBarItem (UIBarButton item inherits from this class) imageInsets.

To use full height images (49px) for finishedSelectedImage and finishedUnselectedImage you need to set these image insets:

tabBarItem.imageInsets = UIEdgeInsetsMake(6, 0, -6, 0);

End of UITabBarItem finishedUnselectedImage example article.