Using #pragma to suppress “Instance method not found” warnings in Xcode

前端 未结 5 859
野性不改
野性不改 2020-12-15 13:23

I want to use #pragma (in Xcode) to suppress the warning:

warning: instance method \'-someMethod\' not found (return type defaults to \'id\'

5条回答
  •  猫巷女王i
    2020-12-15 13:35

    Pavan's link is good but there might also be a simple more obvious answer. Is your isFinishing method in your .m file but declared after its usage (where you get the warning)? If so, move the declaration before its usage. If that simple case is not the answer you might want you can use a category to let the compiler know about this method. I frequently do this to unit test "private" methods. Another option is to use a compiler flag for this file to suppress this warning for the entire file. I know none of those specify how to solve this with a pragma but you might find another solution viable.

提交回复
热议问题