[英]Push/Present Modal View Controller
我的視圖控制器中有一個表(我們稱之為TVC1)。 我在TVC1中使用了行,因此除了TVC1上的數據外,用戶還可以輸入更多數據。 因此,當有人在TVC1中點擊特定行時,它將顯示另一個視圖控制器(讓我們稱之為TVC2)。 但是,當顯示TVC2時,TVC1中的所有數據都被清除。 如何在TVC1中保存數據? 我應該通過應用代表進行嗎?
DescriptionInputViewController *descriptionController = [[DescriptionInputViewController alloc]
initWithNibName:@"DescriptionInputView"
bundle:nil];
[self presentModalViewController:navController animated:YES];
[self.navigationController pushViewController:descriptionController animated:YES];
[descriptionController release];
在您的代碼中,您應該調用:
[self presentModalViewController:descriptionController animated:YES]
descriptionController是您正在顯示的視圖控制器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.