I don't know if I'm doing something wrong or not, but I can't find the problem in my code yet.
I have two main views that I'm trying to get to work. One has been working, the other one won't show up when I call addSubview. And just to be sure, I am commenting their lines of code out to load each one individually for testing.
Here's my code...
UtilAppAppDelegate.h
Code:
#import <UIKit/UIKit.h>
@class UtilAppViewController;
@class DataSynchViewController;
@interface UtilAppAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
UtilAppViewController *dwgViewController;
DataSynchViewController *dsViewController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UtilAppViewController *dwgViewController;
@property (nonatomic, retain) IBOutlet DataSynchViewController *dsViewController;
@end
UtilAppAppDelegate.m
Code:
#import "UtilAppAppDelegate.h"
#import "UtilAppViewController.h"
#import "DataSynchViewController.h"
@implementation UtilAppAppDelegate
@synthesize window;
@synthesize dwgViewController;
@synthesize dsViewController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after app launch
//[window addSubview:dwgViewController.view];
[window addSubview:dsViewController.view];
[window makeKeyAndVisible];
return YES;
}
- (void)dealloc {
[dsViewController release];
[dwgViewController release];
[window release];
[super dealloc];
}
@end
UtilAppViewController.h
Code:
#import <UIKit/UIKit.h>
@interface UtilAppViewController : UIViewController {
}
@end
UtilAppViewController.m
Code:
#import "UtilAppViewController.h"
@implementation UtilAppViewController
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
NSLog(@"Hellos");
}
- (void)dealloc {
[super dealloc];
}
@end
DataSynchViewController.h
Code:
#import <UIKit/UIKit.h>
@interface DataSynchViewController : UIViewController {
}
@end
DataSynchViewController.m
Code:
#import "DataSynchViewController.h"
@implementation DataSynchViewController
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
NSLog(@"Hellos");
}
- (void)dealloc {
[super dealloc];
}
@end
Anyways, when I load up the UtilAppViewController (dwgViewController) I get the NSLog just fine. But when I, instead, try to load up the DataSynchViewController (dsViewController) nothing hapapens. It never gets to the viewDidLoad for that controller. What am I doing wrong here?