我使用IBAction来切换视图而不首先解除根目录。这两个代码都能正常工作,但我想知道它们之间的区别和最佳选择(可能用于内存控制)!区别在于第二行...... [self ...]
-(IBAction)switchpage13:(id)sender
{
UIViewController *parentViewController = self.presentingViewController;
[self dismissViewControllerAnimated:NO completion:^
{
BalladViewController *ballad = [[BalladViewController alloc]
initWithNibName:@"BalladViewController_iPad" bundle:nil];
[parentViewController presentViewController:ballad animated:NO completion:nil];
[ballad release];
}];
}
OR
-(IBAction)switchpage14:(id)sender{
UIViewController *parentViewController = self.presentingViewController;
[self.presentingViewController dismissViewControllerAnimated:NO completion:^
{
PopViewController *pop = [[PopViewController alloc]
initWithNibName:@"PopViewController_iPad" bundle:nil];
[parentViewController presentViewController:pop animated:NO completion:nil];
[pop release];
}];
}