【问题标题】:presentingViewController:animated isn't working [closed]presentingViewController:动画不起作用[关闭]
【发布时间】:2012-09-12 02:20:54
【问题描述】:

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

[self presentingViewController:picker animated: YES];

我不断收到错误提示:

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

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

【问题讨论】:

  • 这个问题似乎离题了,因为它太本地化了。
  • 这个问题似乎跑题了,这是一个明显的问题。

标签: iphone objective-c


【解决方案1】:

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

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

查看UIViewController class reference了解更多详情

【讨论】:

    【解决方案2】:

    正如@danielbeard 所建议的那样,presentingViewController: animated:presentModalViewController: animated:

    presentingViewController 是一个只读属性,它告诉我们:

    “呈现此视图控制器的视图控制器。(只读)”From the doc.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-20
      • 2023-03-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多