gpt4 book ai didi

objective-c - 在 iOS 5 : how to make compatible code with 4. 3 下分离线程和 ARC?

转载 作者:行者123 更新时间:2023-11-28 18:04:25 26 4
gpt4 key购买 nike

所以,我在我的代码中找到了一个地方,我在其中分离了一个线程并且它运行良好。

直到我在 iOS 4.3 上运行代码,然后它会出现数十亿个“NSCFString 类的对象 0x1045660 自动释放,没有适当的池 - 只是泄漏”错误。

但是我不能在线程调用的方法中放置一个自动释放池,因为 NSAutoReleasePool 不能在 ARC 开启时使用。

那么,怎么办?

最佳答案

将它放在@autoreleasepool { }

关于objective-c - 在 iOS 5 : how to make compatible code with 4. 3 下分离线程和 ARC?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8098761/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com