2011-07-26 14 views

答えて

2
  1. あなたは、ルートビューコントローラ
  2. 二つのビュー間のこのルートビューコントローラのスイッチを持っている必要がありますありがとうございました。

このような何か:

- (IBAction)switchViews:(id)sender { 
if (self.vc1 == nil) { 
self.vc1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil]; 
[self.vc2 removeFromSuperview]; 
[self.view addSubView:vc1]; 
vc2 = nil; 
} 
else { 
self.vc2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; 
[self.vc1 removeFromSuperView]; 
[self.view addSubView:vc2]; 
vc1 = nil; 
} 
} 
+1

はどうもありがとうございました! – Shawn

関連する問題