【问题标题】:Method not found (return type defaults to 'id')找不到方法(返回类型默认为 'id')
【发布时间】:2010-08-26 20:24:11
【问题描述】:

有谁知道这个 LLVM 警告是什么意思:

Method '-retry' not found (return type defaults to 'id') in sourceFile.m

我在 sourceFile.m 的以下行收到此警告:

[self.operation retry];

我的类有一个变量“操作”,它是一个扩展 NSOperation 的自定义类。

MyCustomOperation* operation;

@property (nonatomic, retain) MyCustomOperation* operation;

我的自定义操作类有一个方法:

- (void) retry;

似乎一切正常,但我肯定很想摆脱我的警告。

谢谢!

【问题讨论】:

    标签: iphone llvm clang


    【解决方案1】:

    接口中是否也有方法声明- (void) retry;,而不仅仅是实现?

    【讨论】:

    • 是的,方法是在自定义操作的头文件中定义的。
    • 仔细检查重试方法以确保它没有返回任何内容,因为它是无效的。
    【解决方案2】:

    你应该检查你是否导入了MyCustomOperation.h

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-14
      • 1970-01-01
      • 2013-04-17
      相关资源
      最近更新 更多