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.

   

  

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM