Xcode 内存泄露检查出现:nil returned from a method that is expected to return a non-null value iOS 解决方案。
在 使用 Xcode 检查内存泄露时(cmd+shift+B)运行,出现了一个警告:nil returned from a method that is expected to return a non-null value iOS

原因是返回了一个 不能为空 的对象。
解决方案:使用 abort() 函数;
The abort() function is marked with __attribute__((noreturn)), therefore the compiler will not complain about a missing return value.


浙公网安备 33010602011771号