Ignoring return value of function declared with warn_unused_result attribute



  • alt text
    alt text
    Google出了解决方案:
    将以下两个方法:
    SecRandomCopyBytes(kSecRandomDefault, keyBytes.length, keyBytes.mutableBytes);
    SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key);
    前添加(void)即可:
    (void)SecRandomCopyBytes(kSecRandomDefault, keyBytes.length, keyBytes.mutableBytes);
    (void)SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key);
    注:可能是因为Xcode8.0 beta的问题,估计Facebook过段时间会解决


登录后回复