I create app with window base and add new file "viewcontroller"and write code that add my view but don't show.
how can i solve?
in app delagete file.
- (void)applicationDidFinishLaunching
UIApplication *)application {
// login is an object of loginViewController
[window addSubview:[login view]];
[window makeKeyAndVisible];
}
in loginViewControler file.
- (void)loadView {
// the base view for this view controller
UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
contentView.backgroundColor = [UIColor darkGrayColor];
// important for view orientation rotation
contentView.autoresizesSubviews = YES;
contentView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
self.view = contentView;
[contentView release];
// Create and inialize the label.
userLabel = [self newLabel:10 : 20];
// Set the default text that shows on startup.
userLabel.text = @"Username:";
// Add the label as a subview.
[self.view addSubview:userLabel];
}
how can i solve?
in app delagete file.
- (void)applicationDidFinishLaunching
// login is an object of loginViewController
[window addSubview:[login view]];
[window makeKeyAndVisible];
}
in loginViewControler file.
- (void)loadView {
// the base view for this view controller
UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
contentView.backgroundColor = [UIColor darkGrayColor];
// important for view orientation rotation
contentView.autoresizesSubviews = YES;
contentView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
self.view = contentView;
[contentView release];
// Create and inialize the label.
userLabel = [self newLabel:10 : 20];
// Set the default text that shows on startup.
userLabel.text = @"Username:";
// Add the label as a subview.
[self.view addSubview:userLabel];
}