tutorials que apple objective-c xcode storyboard viewcontroller
proyecto de muestra aquíAquí está el zip

objective c - que - Conmutador de storyboard de Xcode



que es el storyboard xcode (2)

¿Alguien me ayudó a entender el nuevo guión gráfico en Xcode 4.2?
Sé cómo codificar para cargar otro controlador de vista pero en el modo de guión gráfico hay diferencias ...

También sé que hay muchos tutoriales sobre los controladores de navegación, pero solo quiero cambiar UIViewControllers en el guión gráfico.

Con los archivos .xib normales, puedo cambiar las vistas con este código desde RootViewController.

SecondViewController *Second = [[SecondViewController alloc] initWithNibName:nil bundle:nil]; [self presentModalViewController:Second animated:YES];

Cuando lo uso en el modo de guión gráfico, simplemente carga el UIAlertView en el SecondViewController.m y la pantalla parece ser negra.

Cualquier ayuda sería apreciada, también adjunta el proyecto Xcode ...

Aquí está el zip ...

-x- Jay Ruben


También puedes cambiar de esta manera:

// get the view that''s currently showing UIView *currentView = self.view; // get the the underlying UIWindow, or the view containing the current view UIView *theWindow = [currentView superview]; UIView *newView = aTwoViewController.view; // remove the current view and replace with myView1 [currentView removeFromSuperview]; [theWindow addSubview:newView]; // set up an animation for the transition between the views CATransition *animation = [CATransition animation]; [animation setDuration:0.5]; [animation setType:kCATransitionPush]; [animation setSubtype:kCATransitionFromRight]; [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; [[theWindow layer] addAnimation:animation forKey:@"SwitchToView2"];

Descargue el proyecto de muestra aquí .


Puedes hacerlo:

SecondViewController *second= [self.storyboard instantiateViewControllerWithIdentifier:@"second"]; [self presentModalViewController:second animated:YES];

No olvides darle al segundo controlador de vista un identificador como "segundo".

De lo contrario, puede conectar ambos controladores de vista con un segue. Mantenga presionada la tecla CTRL desde la primera a la segunda vista Controlador. Ahora puede elegir "presionar" y darle un nombre a la transición para cambiar la vista mediante programación de esta manera:

[self performSegueWithIdentifier:@"second" sender:self];

Los segmentos de inserción solo funcionarán si se configura un controlador de navegación.