Ok I have an app with a tab bar controller and in one of the tabs, there is a navigation controller.
The tabs work fine, and the navigation controller is there, however when I try to click on the button in the first view to move to another view in the navigation controller, I get:
"unrecognized selector sent to instance 0x5d3ee30"
I've built this app purely off of mixing tutorials and videos alone, and am very new to XCode and IB (as in about a week). I feel like I'm so close but need to wrap up some loose ends.
Here's my code:
- DGBankViewController.h
Code:
#import <UIKit/UIKit.h>
#import "DGBankViewController2.h";
@interface DGBankViewController : UIViewController {
IBOutlet DGBankViewController2 *dgBankViewController2;
}
@property (nonatomic, retain) DGBankViewController2 *dgBankViewController2;
-(IBAction)PressMe:(id) sender;
@end
- DGBankViewController.m
Code:
#import "DGBankViewController.h"
#import "DGBankViewController2.h"
@implementation DGBankViewController
@synthesize dgBankViewController2;
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"First View";
}
-(IBAction)PressMe:(id) sender
{
NSLog(@">Entering DGBankViewController PressMe");
DGBankViewController2 * temp = [[DGBankViewController2 alloc] init];
[self setDGBankViewController2:temp];
[temp release];
[[self navigationController] pushViewController:dgBankViewController2 animated:YES];
NSLog(@">Finishing DGBankViewController PressMe");
}
- bankAppDelegate.h
Code:
#import <UIKit/UIKit.h>
@interface bankAppDelegate : NSObject {
IBOutlet UIWindow *window;
//tab bar controller
IBOutlet UITabBarController *rootController;
//navigation controller
IBOutlet UINavigationController *dgBankNavigationController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UITabBarController *rootController;
@property (nonatomic, retain) IBOutlet UINavigationController *dgBankNavigationController;
- bankAppDelegate.m
Code:
#import "bankAppDelegate.h"
@implementation bankAppDelegate
@synthesize window;
//tab bar controller
@synthesize rootController;
//navigation controller
@synthesize dgBankNavigationController;
#pragma mark -
#pragma mark Application lifecycle
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[window addSubview:rootController.view];
[window addSubview:dgBankNavigationController.view];
[window makeKeyAndVisible];
return YES;
}
Any help would be much much appreciated, and I appreciate the time that anyone takes to look this over, thank you.