Reputation: 3234
creating 20 viewcontrollers and calling them one after the other from the mainviewcontroller as views using perform selector method with some delay.
- (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];
}
My question is that loading these many viewcontrollers as views from the mainviewcontroller one after the other using the perform selector method is acceptable or there will be any memory issues.
Please advice.
Upvotes: 0
Views: 93
Reputation: 471
there wont be any memory issues if yiu release it properly but, there are some interactions, such as rotaion etc wont work for the added view controllers(as views). which will make you to manage it yourself, that woul be tedious, and i personally think its a worst thing to do.
Upvotes: 1