Closed geestring closed 12 years ago
The root view controller has to implement the icon methods, not the navigation controller.
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.
I'm not sure I understand you. Could you please provide some code demonstrating this problem.
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.
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
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;
@interface TabBarAppDelegate : NSObject
BCTabBarController *tabBarController;
} @property (nonatomic, retain) BCTabBarController tabBarController; @property (nonatomic, retain) IBOutlet UIWindow window;
@end
and
@implementation TabBarAppDelegate
@synthesize window=_window; @synthesize tabBarController;
(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions { self.tabBarController = [[[BCTabBarController alloc] init] autorelease]; self.tabBarController.viewControllers = [NSArray arrayWithObjects: [[[UINavigationController alloc] initWithRootViewController:[[[EXViewController alloc] init] autorelease]] autorelease], [[[EXViewController alloc] init] autorelease], [[[EXViewController alloc] init] autorelease], [[[EXViewController alloc] init] autorelease], [[[EXViewController alloc] init] autorelease], nil]; [self.window addSubview:self.tabBarController.view];
[self.window makeKeyAndVisible]; return YES; }
@end
I get an error because of the NavController: -[UINavigationController iconImageName]: unrecognized selector sent to instance 0x8e01ba0
What am I doing wrong?
Can't reproduce this issue
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.