No puedo mostrar otro controlador usando presentModalViewController:

Por favor vea el código

   -(IBAction)startGame{
NSLog(@"Button is pressed");

CharadesAppDelegate  *del=(CharadesAppDelegate*)[[UIApplication sharedApplication]delegate];
[del setAllTeams:teamDict];
[del setScore:selectedScroll];
Playing *p=[[Playing alloc]init];
    [self presentModalViewController:p animated:YES];

}

I want to present Playing controller which only contains following line

    - (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"bg.png"]];

} but unfortunately I am not able to switch to another controller nothing happens when I press the button , please help

preguntado el 08 de noviembre de 11 a las 15:11

1 Respuestas

If you are using a nib file for the Playing UIViewController, you should use a different -init:

Playing *playingVC = [[Playing alloc] initWithNibName:@"Playing" bundle:nil];

Remember to change the nib name.

respondido 08 nov., 11:19

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.