I will assume that by "window" you actually mean a new screenful of contents.
First question is: should the user be able to return to the first screen with the button? If yes then you should use a UINavigationController
, or a modal view controller.
The UINavigationController
gives you a navigation bar with a title and "back"-button for free at the top of the screen. Create a new project using the Navigation Template to learn how it works. Using it would be as simple as:
-(IBAction)didTapButton:(id)sender {
CWTheNewController* controller = [[[CWTheNewController alloc] init] autorelease];
[self.navigationController pushViewController:controller animated:YES];
}
The navigation controller is just as simple to use, but the new view controller will cover the whole screen, and it is up to you to provide code/UI to dismiss the controller again:
-(IBAction)didTapButton:(id)sender {
CWTheNewController* controller = [[[CWTheNewController alloc] init] autorelease];
[self presentModalViewController:controller animated:YES];
}
If the user should not be able to navigate back, then instead do something like this to replace the current contents of the screen completely:
-(IBAction)didTapButton:(id)sender {
CWTheNewController* controller = [[[CWTheNewController alloc] init] autorelease];
self.view.window.rootViewController = controller;
}
Either way the first document you should read up and understand is View Controller Programming Guide for iOS. EVERYTHING you do with iOS should be using view controllers, otherwise you are doing it wrong, and extra hard for yourself.