【问题标题】:Instance method not found (return type defaults to 'id')未找到实例方法(返回类型默认为 'id')
【发布时间】:2013-09-13 16:55:04
【问题描述】:

我收到来自 Xcode 的警告:

Instance method '-presentModalViewController:animated:completion:' not found (return type defaults to 'id')

代码如下:

    NewsWebViewController *sampleView = [[[NewsWebViewController alloc] init] autorelease];
    [self presentModalViewController:sampleView animated:YES completion:nil];

}

在与您联系之前,我尝试了您的不同解决方案, 请体谅我的歉意,我是法国人,我用谷歌翻译。

在此先感谢您。

【问题讨论】:

  • self是什么类型的对象?
  • 没有这个方法,是presentViewController:animated:completion:

标签: ios objective-c cocoa-touch uiviewcontroller


【解决方案1】:

该方法称为presentViewController:animated:completion:

此选择器中没有Modal

【讨论】:

  • 好+1,我还有两个以上的警告要纠正,谢谢:)
【解决方案2】:

请查看UIViewController 的参考文档。方法名称为:

presentViewController:animated:completion:

有一个不推荐使用的方法名为:

presentModalViewController:animated:

【讨论】:

  • 好+1,我还有两个以上的警告要纠正,谢谢:)
猜你喜欢
  • 1970-01-01
  • 2011-09-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-14
  • 2013-04-17
相关资源
最近更新 更多