-1

我正在尝试使用相机 API 拍照但是当我尝试使用

[self presentingViewController:picker animated: YES];

我不断收到错误消息:

'MainViewController' 没有可见的@interface 声明选择器'presentingViewController:animated:'

而且我似乎无法弄清楚如何解决它。

4

2 回答 2

3

应该是[self presentModalViewController: picker animated: YES](现已弃用)

或者[self presentViewController:picker animated:YES completion: NULL];

查看UIViewController类参考以获取更多详细信息

于 2012-09-12T02:32:00.947 回答
0

没有什么像@danielbeard 建议presentingViewController: animated:的那样。presentModalViewController: animated:

presentingViewController是一个只读属性,它讲述:

“呈现此视图控制器的视图控制器。(只读)”来自文档。

于 2013-06-26T07:38:49.890 回答