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
Post a Comment