Hello,
I have many years of object oriented programming experience on the major platforms. I need to create an application for my iPhone G3. I've downloaded the development SDK and have successfully generated a few demo applications, so now I am working on my real applicatilon which is based upon the standard tabbed application project generation selection. There are 4 xib files: MainWindow, tabbed view A, tabbed view B, and the view that I want to transition to collect starting and ending times. I am using Interface Builder for designing my views.
My application has a tabbed control bar with three buttons. When the middle tabbed control bar button is pressed, the correct view is displayed and on it is a button. When the button is pressed, I want to transition to another view so I can gather some information from the user and then return to the previous view. Right now, with all of the code commented out, when the button is pressed, a runtime exception is generated:
"unrecognized selector sent to instance XXXX 'NSInvalidArgumentException', reason: [UIViewController handleStartEndTimeButton] unrecognized selector sent."
- (IBAction) handleStartEndTimeButtonid) sender
{
// StartEndTimeViewController *modalStartEndTimeViewController = [[[StartEndTimeViewController alloc]
// initWithNibName: nil bundle:nil] autorelease];
// UINavigationController *modalStartEndTimeNavigationController = [[UINavigationController alloc]
// initWithRootViewController:modalStartEndTimeViewController];
// [self.navigationController
// presentModalViewController:modalStartEndTimeNavigationController animated:YES];
}
Interface Builder shows that the button is connected to my handler function.
I have two questions:
(1) What am I doing wrong with my handler function? Why is an exception generated when the button is pressed? I have three ViewController classes: AViewController, BViewController, and StartEndTimeViewController. BViewController is the one that has the button handler function in it. Do I need to create instances of these ViewController classes? In InterfaceBuilder, I told it which XIB to use with each tabbed button. My gut tells me that I need to create an instance of my ViewControllers somewhere, but where?
(2) Okay, so let's say that we have resolved the issue in item #1. What code do I need to put into the handler function to create the view and show it? I have included what I think will work in the handler function that I showed earlier... Am I close?
I REALLY, REALLY appreciate any guidance!
Thanks!
Mike [/SIZE][/FONT]
I have many years of object oriented programming experience on the major platforms. I need to create an application for my iPhone G3. I've downloaded the development SDK and have successfully generated a few demo applications, so now I am working on my real applicatilon which is based upon the standard tabbed application project generation selection. There are 4 xib files: MainWindow, tabbed view A, tabbed view B, and the view that I want to transition to collect starting and ending times. I am using Interface Builder for designing my views.
My application has a tabbed control bar with three buttons. When the middle tabbed control bar button is pressed, the correct view is displayed and on it is a button. When the button is pressed, I want to transition to another view so I can gather some information from the user and then return to the previous view. Right now, with all of the code commented out, when the button is pressed, a runtime exception is generated:
"unrecognized selector sent to instance XXXX 'NSInvalidArgumentException', reason: [UIViewController handleStartEndTimeButton] unrecognized selector sent."
- (IBAction) handleStartEndTimeButtonid) sender
{
// StartEndTimeViewController *modalStartEndTimeViewController = [[[StartEndTimeViewController alloc]
// initWithNibName: nil bundle:nil] autorelease];
// UINavigationController *modalStartEndTimeNavigationController = [[UINavigationController alloc]
// initWithRootViewController:modalStartEndTimeViewController];
// [self.navigationController
// presentModalViewController:modalStartEndTimeNavigationController animated:YES];
}
Interface Builder shows that the button is connected to my handler function.
I have two questions:
(1) What am I doing wrong with my handler function? Why is an exception generated when the button is pressed? I have three ViewController classes: AViewController, BViewController, and StartEndTimeViewController. BViewController is the one that has the button handler function in it. Do I need to create instances of these ViewController classes? In InterfaceBuilder, I told it which XIB to use with each tabbed button. My gut tells me that I need to create an instance of my ViewControllers somewhere, but where?
(2) Okay, so let's say that we have resolved the issue in item #1. What code do I need to put into the handler function to create the view and show it? I have included what I think will work in the handler function that I showed earlier... Am I close?
I REALLY, REALLY appreciate any guidance!
Thanks!
Mike [/SIZE][/FONT]