I have a very simple entry form. After a button is pressed, I need to show two additional views launched from that view. Here is the error. I am not understanding the error. I thought I had declared two different types. Comments appreciated.
009-11-03 17:17:29.008 eProcessing-iPhone[34257:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing the same view controller instance more than once is not supported ()'
Here is the code:
confirmViewController *anotherViewController = [[confirmViewController alloc] initWithNibName:@"confirmView" bundle:nil];
//set properties
anotherViewController.strConfirmation = [request responseString];
anotherViewController.strCardNumber = txtCardNumber.text;
anotherViewController.strExpires = txtExpires.text;
anotherViewController.strAmount = txtGrandTotal.text;
[self.navigationController pushViewController:anotherViewController animated:YES];
//reset interface
if([anotherViewController.strApproval compare:@"""Y"] == NSOrderedSame)
{
txtCardNumber.text = @"";
txtExpires.text = @"";
txtGrandTotal.text = @"";
txtZip.text = @"";
txtCCV2.text = @"";
txtEmail.text = @"";
txtInvoice.text = @"";
}
[anotherViewController release];
//show signature
sigCaptureViewController *yetAnotherViewController = [[sigCaptureViewController alloc] initWithNibName:@"sigCaptureView" bundle:nil];
[self.navigationController pushViewController:anotherViewController animated:YES];
[yetAnotherViewController release];