如果您创建一个新项目(单视图应用程序)并添加:
,它甚至可以轻松复制// Swift
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
present(UIImagePickerController(), animated: true)
}
或
// Objective-C
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self presentViewController:[UIImagePickerController new] animated:YES completion:NULL];
}
它在iPhone 7模拟器上崩溃。
为什么会发生这种情况?