briancollins / BCTabBarController

a Tweetie-style tab bar for the iPhone
MIT License
568 stars 95 forks source link

Icons don't show up when UIViewController is placed inside UINavController #9

Closed geestring closed 12 years ago

geestring commented 13 years ago

I tried implementing the tab bar in my project, which contains Nav controllers with UIViewControllers just like the example, however the icons don't appear. If I try with just the UIViewController it works. In my project I try to recreate the example, and I even use the EXViewController class. The issue could be that I started the project as a Windows Based Application? That's the only difference I can discern.

briancollins commented 13 years ago

The root view controller has to implement the icon methods, not the navigation controller.

geestring commented 13 years ago

Yes, I have the method in the View Controller. But when I place a view controller in a nav controller then add that to the array it doesnt work. It seems you were able to do it in the example.

briancollins commented 13 years ago

I'm not sure I understand you. Could you please provide some code demonstrating this problem.

geestring commented 13 years ago

I can't do this: [[[UINavigationController alloc] initWithRootViewController:[[[EXViewController alloc] init] autorelease]]autorelease]

If I do that in my project, the Icon does not get used. If I just add EXViewController straight to my tab bar then it'll work.

briancollins commented 13 years ago

But this is done in the example and it works fine. What are you doing differently?

On 7 September 2011 19:05, geestring < reply@reply.github.com>wrote:

I can't do this: [[[UINavigationController alloc] initWithRootViewController:[[[EXViewController alloc] init] autorelease]]autorelease]

If I do that in my project, the Icon does not get used. If I just add EXViewController straight to my tab bar then it'll work.

Reply to this email directly or view it on GitHub:

https://github.com/briancollins/BCTabBarController/issues/9#issuecomment-2031711

geestring commented 13 years ago

Ok, I just did a test project, which I chose Window-Based project.

I hooked BCTabBarController dependencies etc...

copied the bundle and images to my folder just in case.

Copied EXViewController to use in my test.

here is my app delegate:

@class BCTabBarController;

import <UIKit/UIKit.h>

@interface TabBarAppDelegate : NSObject {

BCTabBarController *tabBarController;

} @property (nonatomic, retain) BCTabBarController tabBarController; @property (nonatomic, retain) IBOutlet UIWindow window;

@end

and

import "TabBarAppDelegate.h"

import "EXViewController.h"

import "BCTabBarController.h"

@implementation TabBarAppDelegate

@synthesize window=_window; @synthesize tabBarController;

@end

I get an error because of the NavController: -[UINavigationController iconImageName]: unrecognized selector sent to instance 0x8e01ba0

What am I doing wrong?

briancollins commented 12 years ago

Can't reproduce this issue