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

前端 未结 5 871
野性不改
野性不改 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条回答
  •  孤街浪徒
    2020-12-15 13:32

    See: https://stackoverflow.com/a/34043306/89035 for a #pragma to suppress "instance method not found" warnings.

    While it seem that a true #pragma solution to this does not exist turning off the warnings in individual files can be accomplished by use of the -w switch.

    NB: This solution is for Xcode 4.2 and above

    1. Select the target
    2. Click on the "Build Phases" tab
    3. Under "Compile Sources" add the -w switch to the file(s) you wish to suppress warnings on

    Xcode - compile sources - suppress warnings

提交回复
热议问题