简体   繁体   English

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

[英]Messages without a matching method signature will be assume to return id

I'm getting a warning from the compiler : 我收到来自编译器的警告:

"warning: 'NSSortDescriptor' may not respond to '+sortDescriptorWithKey:ascending:' " “警告:'NSSortDescriptor'可能不响应'+ sortDescriptorWithKey:ascending:'”

...on this line of code: ...在这行代码上:

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

the compiler is also saying the following: 编译器还说以下内容:

"Messages without a matching method signature will be assume to return id..." “将假定没有匹配方法签名的消息返回id ...”

+sortDescriptorWithKey:ascending:is a standard method of the platorm. + sortDescriptorWithKey:升序:是拼版的标准方法。 It's not my own class. 这不是我自己的课。

I think this message usually appears when you don't declare the method in the interface but again, this is not my method. 我认为当您不在接口中声明方法时,通常会出现此消息,但这又不是我的方法。

Any ideas... 有任何想法吗...

The sortDescriptorWithKey:ascending: method was introduced in iOS 4.0. 在iOS 4.0中引入了sortDescriptorWithKey:ascending:方法。 So it sounds like you are compiling with a Base SDK set to something lower than 4.0. 因此,听起来您正在使用设置为低于4.0的Base SDK进行编译。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么会看到以下警告:“假定没有匹配方法签名的消息将返回'id'并接受'...'作为参数”? - Why am I seeing the following warning: “Messages without a matching method signature wii be assumed to return 'id' and accept'…'as arguments ”? 方法签名返回值“类型或子类类的类” - Method signature return value “Class of type or subclass class” 找不到实例方法(返回类型默认为id) - Instance method not found (return type defaults to id) 找不到方法(返回类型默认为“ id”) - Method not found (return type defaults to 'id') 管理对象方法签名 - managed object method signature 假设ViewControllers数据源花费大量时间返回结果是否是错误的做法 - Is it a bad practise to assume that a ViewControllers dataSource takes a lot of time to return the results 未找到实例方法'-jsonValue'(返回类型默认为'id') - Instance method '-jsonValue'not found (return type defaults to 'id') 警告-找不到实例方法'-initWithframe:'(返回类型默认为'id') - warning - Instance method '-initWithframe:' not found (return type defaults to 'id') 方法“-parseRss:条目。” 未找到(返回类型默认为 'id') - Method '-parseRss:entries.' not found (return type defaults to 'id') xcode警告“未找到-method'imagePath'(返回类型默认为'id'”) - xcode warning “-method 'imagePath' not found (return type defaults to 'id' ”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM