我有一個非常簡單的參賽表格。按下按鈕後,我需要顯示從該視圖啓動的另外兩個視圖。這是錯誤。我不瞭解錯誤。我以爲我已經宣佈了兩種不同的類型。評論贊賞。iPhoneSDK:從單個視圖內啓動多個視圖?
009-11-03 17:17:29.008 eProcessing-iPhone [34257:207] ***由於未捕獲的異常'NSInvalidArgumentException',終止應用程序,原因:'不支持多次推送相同的視圖控制器實例()」
下面是代碼:
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];
謝謝你的眼睛。 – 2009-11-04 21:52:18