【问题标题】:Messages without a matching method signature will be assume to return id没有匹配方法签名的消息将被假定返回 id
【发布时间】:2010-11-11 03:48:31
【问题描述】:

我收到了来自编译器的警告:

"警告:'NSSortDescriptor' 可能无法响应'+sortDescriptorWithKey:ascending:'"

...在这行代码上:

id sortDescriptor=[NSSortDescriptor sortDescriptorWithKey:@"value" ascending:YES];

编译器还说以下内容:

“没有匹配方法签名的消息将被假定返回 id...”

+sortDescriptorWithKey:ascending:是平台的标准方法。这不是我自己的课。

我认为当您没有在界面中声明方法时通常会出现此消息,但同样,这不是我的方法。

任何想法...

【问题讨论】:

    标签: iphone ipad


    【解决方案1】:

    sortDescriptorWithKey:ascending: 方法是在 iOS 4.0 中引入的。所以听起来你正在编译一个 Base SDK 设置为低于 4.0 的东西。

    【讨论】:

    • 感谢您的快速回复。 IOS 4.1 已安装,但这适用于 iPad...iOS 3.2。您有什么想法如何以整数值作为排序键对多维数组进行排序?我试图完成这个...stackoverflow.com/questions/3626267/…
    • 我想通了......只是使用了实例方法 -initWithKey:ascending 并且它工作正常。
    猜你喜欢
    • 1970-01-01
    • 2020-04-30
    • 1970-01-01
    • 2015-02-10
    • 2020-10-06
    • 2018-08-28
    • 1970-01-01
    • 2021-11-30
    • 1970-01-01
    相关资源
    最近更新 更多