Here is my code. It is completely identical to mac's code except for "viewController" replaces apple's "myViewController." I have retyped the full code in all of the files and I arranged the .xib files the same way. For some reason though the mac program doesn't have an error with 'aViewController' but my program does. Like I said everything is identical. Help would be greatly appreciated.
#import "newtry1AppDelegate.h"
#import "newtry1ViewController.h"
@implementation newtry1AppDelegate
@synthesize window;
@synthesize viewController;
- (void)applicationDidFinishLaunching: (UIApplication *)application {
viewController *aViewController = [[viewController alloc] initWithNibName"newtry1ViewController" bundle:[NSBundle mainBundle]];
//the error is here "error:'aViewController' undeclared (first use in this function)"
self.viewController = aViewController;
[aViewController release];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque];
UIView *controllerView = [viewController view];
[window addSubview:controllerView];
[window makeKeyAndVisible];
}
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
@end
thank you to those who try to help me
#import "newtry1AppDelegate.h"
#import "newtry1ViewController.h"
@implementation newtry1AppDelegate
@synthesize window;
@synthesize viewController;
- (void)applicationDidFinishLaunching: (UIApplication *)application {
viewController *aViewController = [[viewController alloc] initWithNibName"newtry1ViewController" bundle:[NSBundle mainBundle]];
//the error is here "error:'aViewController' undeclared (first use in this function)"
self.viewController = aViewController;
[aViewController release];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque];
UIView *controllerView = [viewController view];
[window addSubview:controllerView];
[window makeKeyAndVisible];
}
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
@end
thank you to those who try to help me