Pointer is missing a nullability type specifier

后端 未结 6 1802
情书的邮戳
情书的邮戳 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 01:59

    The correct, working method declaration, accepted by compiler:

    - (void)setObject:(nullable id)value
               forKey:(nonnull NSString *)defaultName
        objectChanged:(nullable void(^)(NSUserDefaults *_Nonnull userDefaults, id _Nullable value))changeHandler
        objectRamains:(nullable void(^)(NSUserDefaults *_Nonnull userDefaults, id _Nullable value))remainHandler;
    

提交回复
热议问题