我有ViewCtrl1和StartBtn:
-(IBAction)startbtn
{
ViewCtrl2 *vc2 = [[ViewCtrl2 alloc]init];
[self presentModalViewController:vc2 animated:YES];
}我还有ViewCtrl2、UISegmentedControl和ExitBtn
- (IBAction)exitIt {
[self dismissModalViewControllerAnimated:YES];
}如果在ViewCtrl2中,我选择segment 2或3。当我按ExitBtn时,将显示ViewCtrl1,如果我在ViewCtrl1中按StartBtn,我的ViewCtrl2将显示默认选择的线段,而不是我最近所做的更改。我怎么才能修复它?
发布于 2012-09-25 11:21:03
您每次都会创建新的vc2,当然它会显示默认值。初始化它一次,然后重用。
https://stackoverflow.com/questions/12575736
复制相似问题