Pointer is missing a nullability type specifier

后端 未结 6 1809
情书的邮戳
情书的邮戳 2021-01-31 01:17

In Xcode 7 GM I started to get this warning:

Pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)

6条回答
  •  心在旅途
    2021-01-31 02:08

    To disable this warning across your entire project

    1. Go to Build Settings

    2. Make sure you are viewing the "All" tab not "Basic" or "Customized"

    3. Search for the field Other Warning Flags.

    4. Add the following flag: -Wno-nullability-completeness.

    5. Now clean and build (⇧⌘K then ⌘R)

    6. Quit Xcode and re-open it (Don't skip this step!)

      Note: It can take a few seconds for the warnings to go away even after you finish building and relaunching Xcode, for me it takes about 15 seconds for Xcode to fully update.

提交回复
热议问题