I am writing my first sinful iPhone app. My login screen is ready I thinK. I implemented a View in my MainWindow for login-credentials and add all UI to the view (text boxes etc).
Now what?
I want to check my credentials and if there are okay I will kill the login-view from the main window and show the main view with all information.
How to do?
Can I easily add the button-event in the loginviewcontroller, check the logindata there and get access to the main window and kill from there on the view itself without problems? Or must I declare the button-event from the view in the main window and do all things there?
My Code:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil andDelegate:(id)delegate
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button.frame = CGRectMake(self.view.frame.size.width / 2 - 55.0f, self.view.frame.size.height / 2 + 85.0f
, 110.0f, 35.0f);
[button setTitle:@"title" forState:UIControlStateNormal];
[button addTarget:delegate action:@selector(yourMethodInMainWindow:) forControlEvents: UIControlEventTouchDown];
[self.view addSubview:button];
}
return self;
}