presentModalViewController没有从NSObject类响应

时间:2012-03-14 07:38:07

标签: iphone

我需要从NSObject类调用presentModalViewController。

ViewController *controller = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
        controller.delegate = self;
        controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

    [[appDelegate navigationController] presentModalViewController:controller animated:YES];
    [controller release];

以上代码适用于iPhone,但没有响应iPad View。

1 个答案:

答案 0 :(得分:0)

可能是您的appdeligate或导航控制器正在变为零, 检查你的appdelegate声明一次或使用

[[[[UIApplication sharedApplication] delegate] navigationController] presentModalViewController:imagePicker animated:YES];