2012-02-18 5 views
0

を使用して複数のView Controllerを1つずつビューとして呼び出す20のViewControllerを作成し、mainviewcontrollerから1つずつビューを実行してビューを実行します。performselectorメソッド

- (void)displayviewsAction:(id)sender { 

FirstViewController *viewController = [[FirstViewController alloc] init];  
viewController.view.frame = CGRectMake(0, 0, 320, 480); 
[self.view addSubview:viewController.view]; 
[self performSelector:@selector(secondViewController) withObject:nil afterDelay:11]; 
} 


-(void)secondViewController { 

SecondViewController *secondController = [[SecondViewController alloc] init]; 
secondController.view.frame = CGRectMake(0, 0, 320, 480); 
[self.view addSubview:secondController.view]; 
[self.view addSubview:toolbar]; 

[self performSelector:@selector(ThirdviewController) withObject:nil afterDelay:27]; 

[secondController release]; 
} 

私の質問は、選択方法が許容される実行または任意のメモリの問題が存在するであろう使用して、他の後mainviewcontroller一方から眺めたように、これらの多くのviewcontrollersをロードすることです。

アドバイスをしてください。

答えて

1

yiuが適切にリリースすればメモリの問題はありませんが、追加されたビューコントローラ(ビューとして)では動作しないなど、いくつかのやりとりがあります。それはあなた自身でそれを管理するようになります、その邪悪は退屈であり、私は個人的にそれを最悪のことと思っています。

関連する問題