Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

arme

macrumors member
Original poster
Sep 15, 2008
48
0
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];
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.