我需要从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。
答案 0 :(得分:0)
可能是您的appdeligate或导航控制器正在变为零, 检查你的appdelegate声明一次或使用
行[[[[UIApplication sharedApplication] delegate] navigationController] presentModalViewController:imagePicker animated:YES];