Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-07-2009, 09:46 AM   #1 (permalink)
New Member
 
Join Date: Jul 2009
Posts: 16
Default Tab Bar Images not showing until after clicked

I have created 4 tabs without using Interface Builder (which I find makes things more complicated than they need to be). When I build & go, the simulator will show the first tab bar button image, but the other 3 won't show until after I have clicked them. All 4 tab bar images are custom images. How can I get them to all show from the start?

Here is the code from my MainViewController:

#import "MainViewController.h"
#import "ProofViewController.h"
#import "WhosWhoViewController.h"
#import "DebateViewController.h"
#import "LinksViewController.h"

@implementation MainViewController

@synthesize navigationController;

- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"Main View Did Load: %@", self.tabBarItem.title);
if(self.tabBarItem.title == @"Proof") {
self.tabBarItem.image = [UIImage imageNamed:@"radar.png"];
ProofViewController *proofViewController = [[ProofViewController alloc] init];
[self pushViewController:proofViewController animated:YES];
[proofViewController release];
} else if (self.tabBarItem.title == @"Who's Who") {
self.tabBarItem.image = [UIImage imageNamed:@"runner.png"];
WhosWhoViewController *whosWhoViewController = [[WhosWhoViewController alloc] init];
[self pushViewController:whosWhoViewController animated:YES];
[whosWhoViewController release];
} else if (self.tabBarItem.title == @"Debate") {
self.tabBarItem.image = [UIImage imageNamed:@"chat2.png"];
DebateViewController *debateViewController = [[DebateViewController alloc] init];
[self pushViewController:debateViewController animated:YES];
[debateViewController release];
} else if (self.tabBarItem.title == @"Links") {
self.tabBarItem.image = [UIImage imageNamed:@"cloud.png"];
LinksViewController *linksViewController = [[LinksViewController alloc] init];
[self pushViewController:linksViewController animated:YES];
[linksViewController release];
}

}

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
// Release anything that's not essential, such as cached data
}


- (void)dealloc {
[super dealloc];
[navigationController release];
}


@end

Many thanks!!
Webnasty is offline   Reply With Quote
Old 07-07-2009, 11:39 AM   #2 (permalink)
New Member
 
Join Date: Jul 2009
Posts: 16
Default

Please ignore... I redid in IB instead of coding and now it works fine.
Webnasty is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 334
26 members and 308 guests
adison, ashish1405, crooksy88, edcruise, Erle, Eskema, Falcon80, gbaldwin9, h2h, Hololon, iSdkDev, JimGeldermann, JJJohan, jyu, Leopard, lepetitapps, MarkC, maverick0, Momeks, neil_l, NeoNate, opipes, tester, wilky94, ZunePod
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,239
Threads: 39,016
Posts: 171,115
Top Poster: smasher (2,570)
Welcome to our newest member, Hololon
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:39 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0