在Xcode的项目Edit Schemes里,切换到Diagnostics标签,打开Address Sanitizer 和Detect use of stack after return 选项,如果发生内存地址崩溃的bug,即可抓到。 image.png