ios - Moving between view by presentViewController. Whats going wrong? -


every time press button activating action above, screen goes black. want pass view (or same) without using model proposed storyboard. what's wrong?

thanks

- (ibaction)gotoview:(id)sender {  viewcontroller *controller = [[viewcontroller alloc] initwithnibname:nil bundle:nil]; [self presentviewcontroller:controller animated:yes completion:nil]; 

you haven't configured controller's view.

for example try before presentviewcontroller...

   controller.view.backgroundcolor = [uicolor orangecolor]; 

your screen turn orange...

full example:

- (ibaction)gotoview:(id)sender {      viewcontroller *controller = [[viewcontroller alloc]                                           initwithnibname:nil bundle:nil];     controller.view.backgroundcolor = [uicolor orangecolor];     [self presentviewcontroller:controller animated:yes completion:nil]; 

}


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -